Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codemirror/lang-html

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/lang-html - npm Package Compare versions

Comparing version 6.1.1 to 6.1.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 6.1.2 (2022-09-27)
### Bug fixes
Make tag auto-closing consume `>` characters after the cursor.
## 6.1.1 (2022-09-05)

@@ -2,0 +8,0 @@

13

dist/index.js

@@ -600,4 +600,7 @@ import { parser, configureNesting } from '@lezer/html';

if (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)))
return { range: EditorSelection.cursor(head + 1), changes: { from: head, insert: `></${name}>` } };
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 hasRightBracket = view.state.doc.sliceString(head, head + 1) === ">";
let insert = `${hasRightBracket ? "" : ">"}</${name}>`;
return { range: EditorSelection.cursor(head + 1), changes: { from: head + (hasRightBracket ? 1 : 0), insert } };
}
}

@@ -607,4 +610,6 @@ else if (text == "/" && around.name == "OpenTag") {

if (empty.from == head - 1 && ((_c = base.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && (name = elementName(state.doc, base, head))) {
let insert = `/${name}>`;
return { range: EditorSelection.cursor(head + insert.length), changes: { from: head, insert } };
let hasRightBracket = view.state.doc.sliceString(head, head + 1) === ">";
let insert = `/${name}${hasRightBracket ? "" : ">"}`;
let pos = head + insert.length + (hasRightBracket ? 1 : 0);
return { range: EditorSelection.cursor(pos), changes: { from: head, insert } };
}

@@ -611,0 +616,0 @@ }

{
"name": "@codemirror/lang-html",
"version": "6.1.1",
"version": "6.1.2",
"description": "HTML language support for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc