{"name":"@codemirror/lang-html","version":"6.1.3","keywords":["editor","code"],"author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijnh@gmail.com"},"license":"MIT","_id":"@codemirror/lang-html@6.1.3","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":"b13f542e50c210f8f8ada2fb08f12836593e07fe","tarball":"http://registry-npm.ywwl.com/@codemirror/lang-html/download/@codemirror/lang-html-6.1.3.tgz","fileCount":8,"integrity":"sha512-LmtIElopGK6bBfddAyjBitS6hz8nFr/PVUtvqmfomXlHB4m+Op2d5eGk/X9/CSby6Y8NqXXkGa3yDd9lfJ6Qlg==","signatures":[{"sig":"MEQCIHfAo79rIoM85K0QCeX2k4oSrRvjXoSMc1C7mv8IRg2ZAiAnMe5hmCxsMNU9Ex4knUejdgX5huthjV7zmWOLllBzFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":58546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVn6tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpf1Q//RaeLPzlp5fHFuitg+phnjUCdy9Idhwfz9uT4X4rz7BD1BUyl\r\nIIQcbh+Ud9n7PSiYJm/eOVYUCMdYxgfVNSEf/ZDJGqpUoMhQEoqwY1dGa+ak\r\nxvmDcpED1oxTfaity2znVPSUPd+rXeEazEgJu+fvla030n3sxLd3UPAW1TYB\r\ncjib9Om3XWaWRGrKHQyt9+hthAJWMIbJHYFs3DUj61ckM2xo0LJcr2NPPUve\r\nAqn6ETWRBzptzmo6V+s+LzWcaz4W8WTS3FWjEmwh5OrqAMeuhJUfZirlyqhH\r\nN0M1sSo1ywllXj+nR4AHdAh/qAMD7A6hprBJOo89Kx9rkJvOrroV3aflichO\r\nHSZvSWNkKTN0yppWX9Yw7oWUMzSteYBnUHfVbUR+aLattkfjeMOzNnYEeLSM\r\nyiPrmxPJ6GPCNqZ2YmnNTxl38dZ7gRfuV6e+9vOueE20Ckc+bKg9NLiaoc1a\r\niP3hatAsG88a0fsr8fFMnN+uL80Mtjb/gHoyiD+ML6s2wMH1f2PHWOSUSnmt\r\nnciBzWuVKso4e0pkX7BPQ/mckP8kVO3f5Rx9cpPm5SjEWvzAQxTSGDF71Oku\r\niLUDg/A4YEwZpJEITUPlHqMLZI5JBtz3T/ps/uqcX+qiQ8mo6OfkfqtUs6pX\r\nNZCHfosC7dAH2zquKw1Yc1+k15DtdsjsO7U=\r\n=hUBK\r\n-----END PGP SIGNATURE-----\r\n","size":10735,"noattachment":false,"key":"/@codemirror/lang-html/-/@codemirror/lang-html-6.1.3.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":"9eb58018eb3a9d5cda469e44ea955ad9f7fd1fcc","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.10.0","description":"HTML language support for the CodeMirror code editor","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@lezer/html":"^1.0.1","@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.1.3_1666612909293_0.9068562476297659","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":1666612909620,"_cnpm_publish_time":1666612909620,"dist-tags":{"latest":"6.4.12"}}