Gathering detailed insights and metrics for @codemirror/lang-html
Gathering detailed insights and metrics for @codemirror/lang-html
Gathering detailed insights and metrics for @codemirror/lang-html
Gathering detailed insights and metrics for @codemirror/lang-html
HTML language support for the CodeMirror code editor
npm install @codemirror/lang-html
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
21 Stars
155 Commits
18 Forks
7 Watching
1 Branches
5 Contributors
Updated on 27 Nov 2024
Minified
Minified + Gzipped
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
-2.4%
86,793
Compared to previous day
Last week
4%
485,450
Compared to previous week
Last month
9.1%
2,066,192
Compared to previous month
Last year
88.1%
18,030,894
Compared to previous year
[ WEBSITE | ISSUES | FORUM | CHANGELOG ]
This package implements HTML language support for the CodeMirror code editor.
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
html(config?: Object = {}) → LanguageSupport
Language support for HTML, including
htmlCompletion
and JavaScript and
CSS support extensions.
config
matchClosingTags?: boolean
By default, the syntax tree will highlight mismatched closing
tags. Set this to false
to turn that off (for example when you
expect to only be parsing a fragment of HTML text, not a full
document).
selfClosingTags?: boolean
By default, the parser does not allow arbitrary self-closing tags.
Set this to true
to turn on support for />
self-closing tag
syntax.
autoCloseTags?: boolean
Determines whether autoCloseTags
is included in the support extensions. Defaults to true.
extraTags?: Record<string, TagSpec>
Add additional tags that can be completed.
extraGlobalAttributes?: Record<string, readonly string[] | null>
Add additional completable attributes to all tags.
nestedLanguages?: {tag: string, attrs?: fn(attrs: Object<string>) → boolean, parser: Parser}[]
Register additional languages to parse the content of specific
tags. If given, attrs
should be a function that, given an
object representing the tag's attributes, returns true
if this
language applies.
nestedAttributes?: {name: string, tagName?: string, parser: Parser}[]
Register additional languages to parse attribute values with.
htmlLanguage: LRLanguage
A language provider based on the Lezer HTML
parser, extended with the
JavaScript and CSS parsers to parse the content of <script>
and
<style>
tags.
htmlCompletionSource(context: CompletionContext) → CompletionResult | null
HTML tag completion. Opens and closes tags and attributes in a context-aware way.
interface
TagSpecType used to specify tags to complete.
attrs?: Record<string, readonly string[] | null>
Define tag-specific attributes. Property names are attribute names, and property values can be null to indicate free-form attributes, or a list of strings for suggested attribute values.
globalAttrs?: boolean
When set to false, don't complete global attributes on this tag.
children?: readonly string[]
Can be used to specify a list of child tags that are valid inside this tag. The default is to allow any tag.
htmlCompletionSourceWith(config: Object) → fn(context: CompletionContext) → CompletionResult | null
Create a completion source for HTML extended with additional tags or attributes.
autoCloseTags: Extension
Extension that will automatically insert close tags when a >
or
/
is typed.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More