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 0.19.4 to 0.20.0

6

CHANGELOG.md

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

## 0.20.0 (2022-04-20)
### New features
Autocompletion now suggests the `<template>` and `<slot>` elements.
## 0.19.4 (2021-11-30)

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

3

dist/index.d.ts

@@ -18,3 +18,2 @@ import * as _codemirror_state from '@codemirror/state';

declare const htmlLanguage: LRLanguage;
declare const htmlCompletion: _codemirror_state.Extension;
/**

@@ -45,2 +44,2 @@ Language support for HTML, including

export { autoCloseTags, html, htmlCompletion, htmlCompletionSource, htmlLanguage };
export { autoCloseTags, html, htmlCompletionSource, htmlLanguage };

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

import { syntaxTree, LRLanguage, indentNodeProp, foldNodeProp, LanguageSupport } from '@codemirror/language';
import { styleTags, tags } from '@codemirror/highlight';

@@ -238,2 +237,3 @@ const Targets = ["_blank", "_self", "_top", "_parent"];

},
slot: { attrs: { name: null } },
small: S,

@@ -257,2 +257,3 @@ source: { attrs: { src: null, type: null, media: null } },

td: { attrs: { colspan: null, rowspan: null, headers: null } },
template: S,
textarea: {

@@ -395,3 +396,3 @@ attrs: {

}
const identifier = /^[:\-\.\w\u00b7-\uffff]+$/;
const identifier = /^[:\-\.\w\u00b7-\uffff]*$/;
function completeTag(state, tree, from, to) {

@@ -401,3 +402,3 @@ let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";

options: allowedChildren(state.doc, tree).map(tagName => ({ label: tagName, type: "type" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: "/" + tag, apply: "/" + tag + end, type: "type", boost: 99 - i }))),
span: /^\/?[:\-\.\w\u00b7-\uffff]*$/ };
validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/ };
}

@@ -408,3 +409,3 @@ function completeCloseTag(state, tree, from, to) {

options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: "type", boost: 99 - i })),
span: identifier };
validFor: identifier };
}

@@ -417,3 +418,3 @@ function completeStartTag(state, tree, pos) {

options.push({ label: "</" + open + ">", type: "type", boost: 99 - level++ });
return { from: pos, to: pos, options, span: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
return { from: pos, to: pos, options, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
}

@@ -425,3 +426,3 @@ function completeAttrName(state, tree, from, to) {

options: names.map(attrName => ({ label: attrName, type: "property" })),
span: identifier };
validFor: identifier };
}

@@ -431,3 +432,3 @@ function completeAttrValue(state, tree, from, to) {

let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild("AttributeName");
let options = [], span = undefined;
let options = [], token = undefined;
if (nameNode) {

@@ -443,3 +444,3 @@ let attrName = state.sliceDoc(nameNode.from, nameNode.to);

if (/^['"]/.test(base)) {
span = base[0] == '"' ? /^[^"]*$/ : /^[^']*$/;
token = base[0] == '"' ? /^[^"]*$/ : /^[^']*$/;
quoteStart = "";

@@ -451,3 +452,3 @@ quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? "" : base[0];

else {
span = /^[^\s<>='"]*$/;
token = /^[^\s<>='"]*$/;
}

@@ -458,3 +459,3 @@ for (let value of attrs)

}
return { from, to, options, span };
return { from, to, options, validFor: token };
}

@@ -539,15 +540,2 @@ /**

}
}),
/*@__PURE__*/styleTags({
"Text RawText": tags.content,
"StartTag StartCloseTag SelfCloserEndTag EndTag SelfCloseEndTag": tags.angleBracket,
TagName: tags.tagName,
"MismatchedCloseTag/TagName": [tags.tagName, tags.invalid],
AttributeName: tags.attributeName,
"AttributeValue UnquotedAttributeValue": tags.attributeValue,
Is: tags.definitionOperator,
"EntityReference CharacterReference": tags.character,
Comment: tags.blockComment,
ProcessingInst: tags.processingInstruction,
DoctypeDecl: tags.documentMeta
})

@@ -574,4 +562,2 @@ ],

});
// FIXME remove on next major version
const htmlCompletion = /*@__PURE__*/htmlLanguage.data.of({ autocomplete: htmlCompletionSource });
/**

@@ -587,3 +573,3 @@ Language support for HTML, including

return new LanguageSupport(lang, [
htmlCompletion,
htmlLanguage.data.of({ autocomplete: htmlCompletionSource }),
config.autoCloseTags !== false ? autoCloseTags : [],

@@ -627,2 +613,2 @@ javascript().support,

export { autoCloseTags, html, htmlCompletion, htmlCompletionSource, htmlLanguage };
export { autoCloseTags, html, htmlCompletionSource, htmlLanguage };
{
"name": "@codemirror/lang-html",
"version": "0.19.4",
"version": "0.20.0",
"description": "HTML language support for the CodeMirror code editor",

@@ -29,10 +29,9 @@ "scripts": {

"dependencies": {
"@codemirror/autocomplete": "^0.19.0",
"@codemirror/highlight": "^0.19.6",
"@codemirror/lang-css": "^0.19.0",
"@codemirror/lang-javascript": "^0.19.0",
"@codemirror/language": "^0.19.0",
"@codemirror/state": "^0.19.0",
"@lezer/html": "^0.15.0",
"@lezer/common": "^0.15.0"
"@codemirror/autocomplete": "^0.20.0",
"@codemirror/lang-css": "^0.20.0",
"@codemirror/lang-javascript": "^0.20.0",
"@codemirror/language": "^0.20.0",
"@codemirror/state": "^0.20.0",
"@lezer/html": "^0.16.0",
"@lezer/common": "^0.16.0"
},

@@ -39,0 +38,0 @@ "devDependencies": {

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