@lezer/html
Advanced tools
Comparing version 0.16.0 to 0.16.1
@@ -0,1 +1,7 @@ | ||
## 0.16.1 (2022-05-16) | ||
### Bug fixes | ||
Fix a bug where comment end tokens preceded by dashes were sometimes not recognized. | ||
## 0.16.0 (2022-04-20) | ||
@@ -2,0 +8,0 @@ |
@@ -93,3 +93,3 @@ import { ContextTracker, ExternalTokenizer, LRParser } from '@lezer/lr'; | ||
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33; | ||
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33, dash = 45; | ||
@@ -153,3 +153,3 @@ function ElementContext(name, parent) { | ||
const commentContent = new ExternalTokenizer(input => { | ||
for (let endPos = 0, i = 0;; i++) { | ||
for (let dashes = 0, i = 0;; i++) { | ||
if (input.next < 0) { | ||
@@ -159,10 +159,9 @@ if (i) input.acceptToken(commentContent$1); | ||
} | ||
if (input.next == "-->".charCodeAt(endPos)) { | ||
endPos++; | ||
if (endPos == 3) { | ||
if (i > 3) input.acceptToken(commentContent$1, -2); | ||
break | ||
} | ||
if (input.next == dash) { | ||
dashes++; | ||
} else if (input.next == greaterThan && dashes >= 2) { | ||
if (i > 3) input.acceptToken(commentContent$1, -2); | ||
break | ||
} else { | ||
endPos = 0; | ||
dashes = 0; | ||
} | ||
@@ -169,0 +168,0 @@ input.advance(); |
{ | ||
"name": "@lezer/html", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "lezer-based HTML grammar", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
@@ -72,3 +72,3 @@ /* Hand-written tokenizers for HTML. */ | ||
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33 | ||
const lessThan = 60, greaterThan = 62, slash = 47, question = 63, bang = 33, dash = 45 | ||
@@ -132,3 +132,3 @@ function ElementContext(name, parent) { | ||
export const commentContent = new ExternalTokenizer(input => { | ||
for (let endPos = 0, i = 0;; i++) { | ||
for (let dashes = 0, i = 0;; i++) { | ||
if (input.next < 0) { | ||
@@ -138,10 +138,9 @@ if (i) input.acceptToken(cmntContent) | ||
} | ||
if (input.next == "-->".charCodeAt(endPos)) { | ||
endPos++ | ||
if (endPos == 3) { | ||
if (i > 3) input.acceptToken(cmntContent, -2) | ||
break | ||
} | ||
if (input.next == dash) { | ||
dashes++ | ||
} else if (input.next == greaterThan && dashes >= 2) { | ||
if (i > 3) input.acceptToken(cmntContent, -2) | ||
break | ||
} else { | ||
endPos = 0 | ||
dashes = 0 | ||
} | ||
@@ -148,0 +147,0 @@ input.advance() |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72394
20
1036