@lezer/html
Advanced tools
Comparing version 1.3.6 to 1.3.7
@@ -0,1 +1,9 @@ | ||
## 1.3.7 (2023-11-23) | ||
### Bug fixes | ||
Fix a bug that caused the parser to not properly recognize empty HTML comments. Don't emit nested parses for empty elements in configureNesting | ||
Fix an issue where `configureNesting` could emit empty overlay ranges for empty elements. | ||
## 1.3.6 (2023-07-12) | ||
@@ -2,0 +10,0 @@ |
@@ -169,3 +169,3 @@ import { ContextTracker, ExternalTokenizer, LRParser } from '@lezer/lr'; | ||
} else if (input.next == greaterThan && dashes >= 2) { | ||
if (i > 3) input.acceptToken(commentContent$1, -2); | ||
if (i >= 3) input.acceptToken(commentContent$1, -2); | ||
break | ||
@@ -331,3 +331,5 @@ } else { | ||
let close = n.lastChild; | ||
return {parser: tag.parser, overlay: [{from: open.to, to: close.type.id == CloseTag ? close.from : n.to}]} | ||
let to = close.type.id == CloseTag ? close.from : n.to; | ||
if (to > open.to) | ||
return {parser: tag.parser, overlay: [{from: open.to, to}]} | ||
} | ||
@@ -334,0 +336,0 @@ } |
{ | ||
"name": "@lezer/html", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"description": "lezer-based HTML grammar", | ||
@@ -18,3 +18,3 @@ "main": "dist/index.cjs", | ||
"@lezer/generator": "^1.0.0", | ||
"mocha": "^9.0.1", | ||
"mocha": "^10.2.0", | ||
"rollup": "^2.52.2", | ||
@@ -21,0 +21,0 @@ "@rollup/plugin-node-resolve": "^9.0.0" |
@@ -61,3 +61,5 @@ import {ScriptText, StyleText, TextareaText, | ||
let close = n.lastChild | ||
return {parser: tag.parser, overlay: [{from: open.to, to: close.type.id == CloseTag ? close.from : n.to}]} | ||
let to = close.type.id == CloseTag ? close.from : n.to | ||
if (to > open.to) | ||
return {parser: tag.parser, overlay: [{from: open.to, to}]} | ||
} | ||
@@ -64,0 +66,0 @@ } |
@@ -140,3 +140,3 @@ /* Hand-written tokenizers for HTML. */ | ||
} else if (input.next == greaterThan && dashes >= 2) { | ||
if (i > 3) input.acceptToken(cmntContent, -2) | ||
if (i >= 3) input.acceptToken(cmntContent, -2) | ||
break | ||
@@ -143,0 +143,0 @@ } else { |
@@ -120,6 +120,9 @@ # Regular tag | ||
<element><!-- inner comment --> text</element> | ||
<!----> | ||
<!-- | ||
--> | ||
==> | ||
Document(Comment,Text,Element(OpenTag(StartTag,TagName,EndTag),Comment,Text,CloseTag(StartCloseTag,TagName,EndTag))) | ||
Document(Comment,Text,Element(OpenTag(StartTag,TagName,EndTag),Comment,Text,CloseTag(StartCloseTag,TagName,EndTag)),Text,Comment,Text,Comment) | ||
@@ -126,0 +129,0 @@ # Mismatched tag |
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
93362
22
1249