@lezer/html
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -0,1 +1,7 @@ | ||
## 1.3.4 (2023-03-27) | ||
### Bug fixes | ||
Fix a bug that caused mixed parsing of non-style/script elements to attach the nested parse tree to the incorrect node. | ||
## 1.3.3 (2023-02-21) | ||
@@ -2,0 +8,0 @@ |
@@ -325,8 +325,8 @@ import { ContextTracker, ExternalTokenizer, LRParser } from '@lezer/lr'; | ||
if (id == OpenTag && other.length) { | ||
let n = node.node, tagName = findTagName(n, input), attrs; | ||
for (let tag of other) { | ||
if (id == Element && other.length) { | ||
let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs; | ||
if (tagName) for (let tag of other) { | ||
if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(n, input))))) { | ||
let close = n.parent.lastChild; | ||
return {parser: tag.parser, overlay: [{from: node.to, to: close.type.id == CloseTag ? close.from : n.parent.to}]} | ||
let close = n.lastChild; | ||
return {parser: tag.parser, overlay: [{from: open.to, to: close.type.id == CloseTag ? close.from : n.to}]} | ||
} | ||
@@ -333,0 +333,0 @@ } |
{ | ||
"name": "@lezer/html", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "lezer-based HTML grammar", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
@@ -56,8 +56,8 @@ import {ScriptText, StyleText, TextareaText, | ||
if (id == OpenTag && other.length) { | ||
let n = node.node, tagName = findTagName(n, input), attrs | ||
for (let tag of other) { | ||
if (id == Element && other.length) { | ||
let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs | ||
if (tagName) for (let tag of other) { | ||
if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(n, input))))) { | ||
let close = n.parent.lastChild | ||
return {parser: tag.parser, overlay: [{from: node.to, to: close.type.id == CloseTag ? close.from : n.parent.to}]} | ||
let close = n.lastChild | ||
return {parser: tag.parser, overlay: [{from: open.to, to: close.type.id == CloseTag ? close.from : n.to}]} | ||
} | ||
@@ -64,0 +64,0 @@ } |
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
98715