remark-break-line 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -213,7 +213,6 @@ export default function remarkBreakLongLines({ maxLineLength = 80 } = {}) {
|
|
|
213
213
|
for (let i = 0; i < node.children.length; i++) {
|
|
214
214
|
const element = node.children[i]
|
|
215
215
|
const result = walk(element, [element.type])
|
|
216
|
-
|
|
217
216
|
if (result.type == 'split') {
|
|
218
217
|
currentLine = 0
|
|
219
218
|
node.children.splice(i, 1, result.replaceBy[0], { type: 'text', value: '\n' }, result.replaceBy[1])
|
|
@@ -226,6 +225,10 @@ export default function remarkBreakLongLines({ maxLineLength = 80 } = {}) {
|
|
|
226
225
|
prev.value = prev.value.trimEnd();
|
|
227
226
|
}
|
|
228
227
|
}
|
|
228
|
+
} else if (currentLine > 0) {
|
|
229
|
+
// @ts-ignore
|
|
230
|
+
const additional = (elementSize[element.type] ?? 0) * 2;
|
|
231
|
+
currentLine += additional;
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
234
|
}
|