@codemirror/lang-html
Advanced tools
Comparing version 6.4.8 to 6.4.9
@@ -0,1 +1,7 @@ | ||
## 6.4.9 (2024-04-12) | ||
### Bug fixes | ||
Fix a bug in `autoCloseTags` that made tags not close when typing > after an attribute. | ||
## 6.4.8 (2024-01-23) | ||
@@ -2,0 +8,0 @@ |
@@ -630,8 +630,7 @@ import { parser, configureNesting } from '@lezer/html'; | ||
let didType = state.doc.sliceString(range.from - 1, range.to) == text; | ||
let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name; | ||
if (around.name == "TagName" || around.name == "StartTag") | ||
around = around.parent; | ||
if (didType && text == ">" && around.name == "OpenTag") { | ||
if (((_b = (_a = around.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && | ||
(name = elementName(state.doc, around.parent, head)) && | ||
let { head } = range, after = syntaxTree(state).resolveInner(head, -1), name; | ||
if (didType && text == ">" && after.name == "EndTag") { | ||
let tag = after.parent; | ||
if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && | ||
(name = elementName(state.doc, tag.parent, head)) && | ||
!selfClosers.has(name)) { | ||
@@ -643,6 +642,6 @@ let to = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0); | ||
} | ||
else if (didType && text == "/" && around.name == "IncompleteCloseTag") { | ||
let base = around.parent; | ||
if (around.from == head - 2 && ((_c = base.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && | ||
(name = elementName(state.doc, base, head)) && !selfClosers.has(name)) { | ||
else if (didType && text == "/" && after.name == "IncompleteCloseTag") { | ||
let tag = after.parent; | ||
if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && | ||
(name = elementName(state.doc, tag, head)) && !selfClosers.has(name)) { | ||
let to = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0); | ||
@@ -649,0 +648,0 @@ let insert = `${name}>`; |
{ | ||
"name": "@codemirror/lang-html", | ||
"version": "6.4.8", | ||
"version": "6.4.9", | ||
"description": "HTML language support for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
78207
1448