Skip to content

Commit b929eb3

Browse files
authored
Fix no end-of-file linefeed producing duplicates
Closes GH-4. Closes GH-5. Reviewed-by: Christian Murphy <[email protected]>
1 parent fe1b23d commit b929eb3

File tree

4 files changed

+121
-3
lines changed

4 files changed

+121
-3
lines changed

Diff for: index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function toNlcst(tree, file, Parser) {
162162
} else if (child && start === -1) {
163163
find(child)
164164
start = index + 1
165-
} else {
165+
} else if (start !== -1) {
166166
;(viable ? add : findAll)(children.slice(start, index))
167167

168168
if (child) {

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"parse-latin": "^4.0.0",
4242
"prettier": "^1.0.0",
4343
"rehype": "^9.0.0",
44-
"remark-cli": "^6.0.0",
45-
"remark-preset-wooorm": "^5.0.0",
44+
"remark-cli": "^7.0.0",
45+
"remark-preset-wooorm": "^6.0.0",
4646
"tape": "^4.0.0",
4747
"tinyify": "^2.0.0",
4848
"vfile": "^4.0.0",
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>🤔</p><p></p>
+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"type": "RootNode",
3+
"children": [
4+
{
5+
"type": "ParagraphNode",
6+
"children": [
7+
{
8+
"type": "SentenceNode",
9+
"children": [
10+
{
11+
"type": "SymbolNode",
12+
"value": "🤔",
13+
"position": {
14+
"start": {
15+
"line": 1,
16+
"column": 4,
17+
"offset": 3
18+
},
19+
"end": {
20+
"line": 1,
21+
"column": 6,
22+
"offset": 5
23+
}
24+
}
25+
}
26+
],
27+
"position": {
28+
"start": {
29+
"line": 1,
30+
"column": 4,
31+
"offset": 3
32+
},
33+
"end": {
34+
"line": 1,
35+
"column": 6,
36+
"offset": 5
37+
}
38+
}
39+
}
40+
],
41+
"position": {
42+
"start": {
43+
"line": 1,
44+
"column": 4,
45+
"offset": 3
46+
},
47+
"end": {
48+
"line": 1,
49+
"column": 6,
50+
"offset": 5
51+
}
52+
}
53+
},
54+
{
55+
"type": "ParagraphNode",
56+
"children": [
57+
{
58+
"type": "SentenceNode",
59+
"children": [
60+
{
61+
"type": "SymbolNode",
62+
"value": "",
63+
"position": {
64+
"start": {
65+
"line": 1,
66+
"column": 13,
67+
"offset": 12
68+
},
69+
"end": {
70+
"line": 1,
71+
"column": 14,
72+
"offset": 13
73+
}
74+
}
75+
}
76+
],
77+
"position": {
78+
"start": {
79+
"line": 1,
80+
"column": 13,
81+
"offset": 12
82+
},
83+
"end": {
84+
"line": 1,
85+
"column": 14,
86+
"offset": 13
87+
}
88+
}
89+
}
90+
],
91+
"position": {
92+
"start": {
93+
"line": 1,
94+
"column": 13,
95+
"offset": 12
96+
},
97+
"end": {
98+
"line": 1,
99+
"column": 14,
100+
"offset": 13
101+
}
102+
}
103+
}
104+
],
105+
"position": {
106+
"start": {
107+
"line": 1,
108+
"column": 1,
109+
"offset": 0
110+
},
111+
"end": {
112+
"line": 1,
113+
"column": 18,
114+
"offset": 17
115+
}
116+
}
117+
}

0 commit comments

Comments
 (0)