{"name":"@codemirror/lang-html","version":"6.4.0","keywords":["editor","code"],"author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijnh@gmail.com"},"license":"MIT","_id":"@codemirror/lang-html@6.4.0","maintainers":[{"name":"adrianheine","email":"mail@adrianheine.de"},{"name":"marijn","email":"marijnh@gmail.com"}],"homepage":"https://github.com/codemirror/lang-html#readme","bugs":{"url":"https://github.com/codemirror/lang-html/issues"},"dist":{"shasum":"55227541426ec4efb13d9da45d7a85cabaa45c73","tarball":"http://registry-npm.ywwl.com/@codemirror/lang-html/download/@codemirror/lang-html-6.4.0.tgz","fileCount":8,"integrity":"sha512-HHged0d9AQ/mpjYLTYDVdtI7235dO0COFNgc5uuiGokgjWx3L/sjMSw5aS/Nk7JG++LhsohG5HMNTCuqAq3Tcg==","signatures":[{"sig":"MEUCIF38ce5++BjmkwUzwv4cKHraUcM914lqKVw3iSbFrvilAiEAwbe9YgUQYcFPalogb1jmPm7WU9ewQKFZGTeyb/v1vZc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":70352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh7yGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQgw//T7SpjvSCyoRjlq2xJrsAvprAd66BF7c2V8KbgrruaPiQ3w+D\r\nEMXH4mpowOMtsrAAr8Ep/rGFIvH1+t+WVBQyhWcGb1qcgJ1i+SP10NVUe4W4\r\nmDcXdqpY3AHrtEMyW76hFH2YnGLQYUx58WQonoqr4ILHS2LzHXJKCrNeEbZy\r\ntfv9InltaaYvUZkBe2HR8IUNBDYaxSuL61iNPcO6Ed1pTNzOBEJjHuUF2mHz\r\n5Jad+BSOTFXsPpB0jbcG3PaUw2kXw6s3o+QSnBwr9mQocbnG8MucHDBDjUOb\r\n0I7XEEZuq68hr7rmvWxI7tyLf64JcbFpKKGa80dy59Wo2CJgU9RtqsC7etCn\r\nENcQYpJQx/gxN2WpzWU8W7r5yNOW+jWmBh9XoMpCtyobt4OUDOzFueOcfSzb\r\nCX8TOZxRLw/gR1Ic6dulH0v3xugOtH0EU/gmn/Gx6oZCT2GssWsJUxzN/N8W\r\nzxhEGKG34njdfcbaESvxfiu0LdeprDhDKELBk/Z3rGvOwjcMOELpYH+ctOmV\r\nGYssRcOs1p1QYlVwoDbjwXJmNozshHxXrco/DNA/qO6MC2eg+2BecrrWIIcb\r\n9Cg9TNXQzC50yHHPVDNHrIdU9JcjXnUH1zV+s3087mgRtywc6n+kup/KRJBv\r\noj3MDlkfTXV4guNUblxO9lGUNzzAvYFaPwg=\r\n=+iKM\r\n-----END PGP SIGNATURE-----\r\n","size":12367,"noattachment":false,"key":"/@codemirror/lang-html/-/@codemirror/lang-html-6.4.0.tgz"},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"f1b0d096f58bf5da7c59d5cfe2bd697397ce2696","scripts":{"test":"cm-runtests","prepare":"cm-buildhelper src/html.ts"},"_npmUser":{"name":"marijn","email":"marijnh@gmail.com"},"repository":{"url":"git+https://github.com/codemirror/lang-html.git","type":"git"},"_npmVersion":"8.19.2","description":"HTML language support for the CodeMirror code editor","directories":{},"sideEffects":false,"_nodeVersion":"18.12.1","dependencies":{"@lezer/css":"^1.1.0","@lezer/html":"^1.1.0","@lezer/common":"^1.0.0","@codemirror/view":"^6.2.2","@codemirror/state":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/language":"^6.0.0","@codemirror/autocomplete":"^6.0.0","@codemirror/lang-javascript":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@codemirror/buildhelper":"^0.1.5"},"_npmOperationalInternal":{"tmp":"tmp/lang-html_6.4.0_1669840006715_0.39716003763075625","host":"s3://npm-registry-packages"},"readme":"<!-- NOTE: README.md is generated from src/README.md -->\n\n# @codemirror/lang-html [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-html.svg)](https://www.npmjs.org/package/@codemirror/lang-html)\n\n[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/lang-html/src/branch/main/CHANGELOG.md) ]\n\nThis package implements HTML language support for the\n[CodeMirror](https://codemirror.net/) code editor.\n\nThe [project page](https://codemirror.net/) has more information, a\nnumber of [examples](https://codemirror.net/examples/) and the\n[documentation](https://codemirror.net/docs/).\n\nThis code is released under an\n[MIT license](https://code.haverbeke.berlin/codemirror/lang-html/tree/main/LICENSE).\n\nWe aim to be an inclusive, welcoming community. To make that explicit,\nwe have a [code of\nconduct](http://contributor-covenant.org/version/1/1/0/) that applies\nto communication around the project.\n\n## Usage\n\n```javascript\nimport {EditorView, basicSetup} from \"codemirror\"\nimport {html} from \"@codemirror/lang-html\"\n\nconst view = new EditorView({\n  parent: document.body,\n  doc: `<!doctype html>\\n<title>HTML</title>`,\n  extensions: [basicSetup, html()]\n})\n```\n\n## API Reference\n\n<dl>\n<dt id=\"user-content-html\">\n  <code><strong><a href=\"#user-content-html\">html</a></strong>(<a id=\"user-content-html^config\" href=\"#user-content-html^config\">config</a>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\">Object</a> = {}) → <a href=\"https://codemirror.net/docs/ref#language.LanguageSupport\">LanguageSupport</a></code></dt>\n\n<dd><p>Language support for HTML, including\n<a href=\"#user-content-htmlcompletion\"><code>htmlCompletion</code></a> and JavaScript and\nCSS support extensions.</p>\n<dl><dt id=\"user-content-html^config\">\n  <code><strong><a href=\"#user-content-html^config\">config</a></strong></code></dt>\n\n<dd><dl><dt id=\"user-content-html^config.matchclosingtags\">\n  <code><strong><a href=\"#user-content-html^config.matchclosingtags\">matchClosingTags</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a></code></dt>\n\n<dd><p>By default, the syntax tree will highlight mismatched closing\ntags. Set this to <code>false</code> to turn that off (for example when you\nexpect to only be parsing a fragment of HTML text, not a full\ndocument).</p>\n</dd><dt id=\"user-content-html^config.selfclosingtags\">\n  <code><strong><a href=\"#user-content-html^config.selfclosingtags\">selfClosingTags</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a></code></dt>\n\n<dd><p>By default, the parser does not allow arbitrary self-closing tags.\nSet this to <code>true</code> to turn on support for <code>/&gt;</code> self-closing tag\nsyntax.</p>\n</dd><dt id=\"user-content-html^config.autoclosetags\">\n  <code><strong><a href=\"#user-content-html^config.autoclosetags\">autoCloseTags</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a></code></dt>\n\n<dd><p>Determines whether <a href=\"#user-content-autoclosetags\"><code>autoCloseTags</code></a>\nis included in the support extensions. Defaults to true.</p>\n</dd><dt id=\"user-content-html^config.extratags\">\n  <code><strong><a href=\"#user-content-html^config.extratags\">extraTags</a></strong>&#8288;?: <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype\">Record</a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, <a href=\"#user-content-tagspec\">TagSpec</a>&gt;</code></dt>\n\n<dd><p>Add additional tags that can be completed.</p>\n</dd><dt id=\"user-content-html^config.extraglobalattributes\">\n  <code><strong><a href=\"#user-content-html^config.extraglobalattributes\">extraGlobalAttributes</a></strong>&#8288;?: <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype\">Record</a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, readonly <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>[] | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a>&gt;</code></dt>\n\n<dd><p>Add additional completable attributes to all tags.</p>\n</dd><dt id=\"user-content-html^config.nestedlanguages\">\n  <code><strong><a href=\"#user-content-html^config.nestedlanguages\">nestedLanguages</a></strong>&#8288;?: {tag: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, attrs&#8288;?: fn(<a id=\"user-content-html^config.nestedlanguages.attrs^attrs\" href=\"#user-content-html^config.nestedlanguages.attrs^attrs\">attrs</a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\">Object</a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>&gt;) → <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a>, parser: <a href=\"https://lezer.codemirror.net/docs/ref/#common.Parser\">Parser</a>}[]</code></dt>\n\n<dd><p>Register additional languages to parse the content of specific\ntags. If given, <code>attrs</code> should be a function that, given an\nobject representing the tag's attributes, returns <code>true</code> if this\nlanguage applies.</p>\n</dd><dt id=\"user-content-html^config.nestedattributes\">\n  <code><strong><a href=\"#user-content-html^config.nestedattributes\">nestedAttributes</a></strong>&#8288;?: {name: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, tagName&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, parser: <a href=\"https://lezer.codemirror.net/docs/ref/#common.Parser\">Parser</a>}[]</code></dt>\n\n<dd><p>Register additional languages to parse attribute values with.</p>\n</dd></dl></dd></dl></dd>\n<dt id=\"user-content-htmllanguage\">\n  <code><strong><a href=\"#user-content-htmllanguage\">htmlLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>A language provider based on the <a href=\"https://code.haverbeke.berlin/lezer/html\">Lezer HTML\nparser</a>, extended with the\nJavaScript and CSS parsers to parse the content of <code>&lt;script&gt;</code> and\n<code>&lt;style&gt;</code> tags.</p>\n</dd>\n<dt id=\"user-content-htmlcompletionsource\">\n  <code><strong><a href=\"#user-content-htmlcompletionsource\">htmlCompletionSource</a></strong>(<a id=\"user-content-htmlcompletionsource^context\" href=\"#user-content-htmlcompletionsource^context\">context</a>: <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionContext\">CompletionContext</a>) → <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionResult\">CompletionResult</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a></code></dt>\n\n<dd><p>HTML tag completion. Opens and closes tags and attributes in a\ncontext-aware way.</p>\n</dd>\n<dt id=\"user-content-tagspec\">\n  <h4>\n    <code>interface</code>\n    <a href=\"#user-content-tagspec\">TagSpec</a></h4>\n</dt>\n\n<dd><p>Type used to specify tags to complete.</p>\n<dl><dt id=\"user-content-tagspec.attrs\">\n  <code><strong><a href=\"#user-content-tagspec.attrs\">attrs</a></strong>&#8288;?: <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype\">Record</a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, readonly <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>[] | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a>&gt;</code></dt>\n\n<dd><p>Define tag-specific attributes. Property names are attribute\nnames, and property values can be null to indicate free-form\nattributes, or a list of strings for suggested attribute values.</p>\n</dd><dt id=\"user-content-tagspec.globalattrs\">\n  <code><strong><a href=\"#user-content-tagspec.globalattrs\">globalAttrs</a></strong>&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a></code></dt>\n\n<dd><p>When set to false, don't complete global attributes on this tag.</p>\n</dd><dt id=\"user-content-tagspec.children\">\n  <code><strong><a href=\"#user-content-tagspec.children\">children</a></strong>&#8288;?: readonly <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>[]</code></dt>\n\n<dd><p>Can be used to specify a list of child tags that are valid\ninside this tag. The default is to allow any tag.</p>\n</dd></dl>\n\n</dd>\n<dt id=\"user-content-htmlcompletionsourcewith\">\n  <code><strong><a href=\"#user-content-htmlcompletionsourcewith\">htmlCompletionSourceWith</a></strong>(<a id=\"user-content-htmlcompletionsourcewith^config\" href=\"#user-content-htmlcompletionsourcewith^config\">config</a>: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\">Object</a>) → fn(<a id=\"user-content-htmlcompletionsourcewith^returns^context\" href=\"#user-content-htmlcompletionsourcewith^returns^context\">context</a>: <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionContext\">CompletionContext</a>) → <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionResult\">CompletionResult</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a></code></dt>\n\n<dd><p>Create a completion source for HTML extended with additional tags\nor attributes.</p>\n<dl><dt id=\"user-content-htmlcompletionsourcewith^config\">\n  <code><strong><a href=\"#user-content-htmlcompletionsourcewith^config\">config</a></strong></code></dt>\n\n<dd><dl><dt id=\"user-content-htmlcompletionsourcewith^config.extratags\">\n  <code><strong><a href=\"#user-content-htmlcompletionsourcewith^config.extratags\">extraTags</a></strong>&#8288;?: <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype\">Record</a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, <a href=\"#user-content-tagspec\">TagSpec</a>&gt;</code></dt>\n\n<dd><p>Define extra tag names to complete.</p>\n</dd><dt id=\"user-content-htmlcompletionsourcewith^config.extraglobalattributes\">\n  <code><strong><a href=\"#user-content-htmlcompletionsourcewith^config.extraglobalattributes\">extraGlobalAttributes</a></strong>&#8288;?: <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype\">Record</a>&lt;<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>, readonly <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>[] | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a>&gt;</code></dt>\n\n<dd><p>Add global attributes that are available on all tags.</p>\n</dd></dl></dd></dl></dd>\n<dt id=\"user-content-autoclosetags\">\n  <code><strong><a href=\"#user-content-autoclosetags\">autoCloseTags</a></strong>: <a href=\"https://codemirror.net/docs/ref#state.Extension\">Extension</a></code></dt>\n\n<dd><p>Extension that will automatically insert close tags when a <code>&gt;</code> or\n<code>/</code> is typed.</p>\n</dd>\n</dl>\n","publish_time":1669840006914,"_cnpm_publish_time":1669840006914,"dist-tags":{"latest":"6.4.12"}}