remark-break-line 0.0.12 → 0.0.14
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 +6 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -206,10 +206,15 @@ export default function remarkBreakLongLines({ maxLineLength = 80, removeLinebre
|
|
|
206
206
|
// We need to increase i because we increase the text
|
|
207
207
|
i++
|
|
208
208
|
n.value = '\n' + n.value
|
|
209
|
+
currentLine = i - lastIndex
|
|
210
|
+
} else if (currentLine + additionalCharacters == maxLineLength - baseIndention) {
|
|
211
|
+
n.value = replaceAt(n.value, i, '\n')
|
|
212
|
+
currentLine = 0;
|
|
213
|
+
|
|
209
214
|
} else {
|
|
210
215
|
n.value = replaceAt(n.value, lastIndex, '\n')
|
|
216
|
+
currentLine = i - lastIndex
|
|
211
217
|
}
|
|
212
|
-
currentLine = i - lastIndex
|
|
213
218
|
}
|
|
214
219
|
}
|
|
215
220
|
|