8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee33316 commit 841ff6eCopy full SHA for 841ff6e
src/tokens.js
@@ -28,11 +28,13 @@ function isLineBreak(ch) {
28
}
29
30
export const newlines = new ExternalTokenizer((input, stack) => {
31
+ let prev
32
if (input.next < 0) {
33
input.acceptToken(eof)
34
} else if (stack.context.depth < 0) {
35
if (isLineBreak(input.next)) input.acceptToken(newlineBracketed, 1)
- } else if (isLineBreak(input.peek(-1)) && stack.canShift(blankLineStart)) {
36
+ } else if (((prev = input.peek(-1)) < 0 || isLineBreak(prev)) &&
37
+ stack.canShift(blankLineStart)) {
38
let spaces = 0
39
while (input.next == space || input.next == tab) { input.advance(); spaces++ }
40
if (input.next == newline || input.next == carriageReturn || input.next == hash)
0 commit comments