From edc4bf3db5ac90e1e579cc1a282348351bbca201 Mon Sep 17 00:00:00 2001 From: Ben Ashton Date: Sun, 4 Sep 2022 23:36:32 -0600 Subject: [PATCH] Fixed issue with skipping newlines --- src/token_stream.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/token_stream.mjs b/src/token_stream.mjs index 49592e6..7b319a0 100644 --- a/src/token_stream.mjs +++ b/src/token_stream.mjs @@ -72,12 +72,12 @@ export class TokenStream { return flushRaw() || this._readInlineStatementUnescaped(); } else if ( this._cs.column === 0 && - this._cs.peekAfter(this._isWhitespace) === TokenStream.STATEMENT + this._cs.peekAfter(this._isSpace) === TokenStream.STATEMENT ) { return flushRaw() || this._readStatement(); } else if ( this._cs.column === 0 && - this._cs.peekAfter(this._isWhitespace) === TokenStream.COMMENT + this._cs.peekAfter(this._isSpace) === TokenStream.COMMENT ) { return flushRaw() || this._readComment(); } else { @@ -169,7 +169,7 @@ export class TokenStream { _readFullLineGeneric(tokenType, tag) { // Skip whitespace - this._cs.nextWhile(this._isWhitespace); + this._cs.nextWhile(this._isSpace); // Skip tag this._cs.next(tag.length); @@ -206,7 +206,7 @@ export class TokenStream { } // Utility methods - _isWhitespace(c) { - return /\s/.test(c); + _isSpace(c) { + return /^\S\r\n/.test(c); } }