From d88cc7ba9dab0ca578af4e1bddcb0b8e4fade270 Mon Sep 17 00:00:00 2001 From: Blaise Date: Fri, 28 Oct 2022 15:26:07 -0500 Subject: Use firstToken in class for line numbers --- microlight.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'microlight.js') diff --git a/microlight.js b/microlight.js index 295cad2..a0ae720 100644 --- a/microlight.js +++ b/microlight.js @@ -79,9 +79,8 @@ // checking if current token should be finalized if (!chr || // end of content - // types 9-10 (single-line comments) end with a // newline - (tokenType > 8 && chr == '\n') || + chr == '\n' || prev1 == '\n' || [ // finalize conditions for other token types // 0: whitespaces /\S/[test](chr), // merged together @@ -109,7 +108,7 @@ // (some types are highlighted similarly) el[appendChild]( node = _document.createElement('span') - ).setAttribute('class', 'c'+( + ).setAttribute('class', 'f'+(firstToken|0)+' c'+( // not formatted !tokenType ? 0 : // diff -- cgit v1.2.3