Skip to content

Commit

Permalink
Fix doc comment for selfClosingTags option
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jun 4, 2024
1 parent ce093de commit 10335e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ to communication around the project.

<dl>
<dt id="user-content-html">
<code><strong><a href="#user-content-html">html</a></strong>(<a id="user-content-html^config" href="#user-content-html^config">config</a>&#8288;?: {selfClosingTags&#8288;?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>} = {}) → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>
<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>

<dd><p>Language support for HTML, including
<a href="#user-content-htmlcompletion"><code>htmlCompletion</code></a> and JavaScript and
Expand All @@ -38,6 +38,12 @@ CSS support extensions.</p>
tags. Set this to <code>false</code> to turn that off (for example when you
expect to only be parsing a fragment of HTML text, not a full
document).</p>
</dd><dt id="user-content-html^config.selfclosingtags">
<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>

<dd><p>By default, the parser does not allow arbitrary self-closing tags.
Set this to <code>true</code> to turn on support for <code>/&gt;</code> self-closing tag
syntax.</p>
</dd><dt id="user-content-html^config.autoclosetags">
<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>

Expand Down
12 changes: 4 additions & 8 deletions src/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ const defaultAttrs: NestedAttr[] = [
parser: cssLanguage.parser.configure({top: "Styles"})}
].concat(eventAttributes.map(name => ({name, parser: javascriptLanguage.parser})))

/// A language provider based on the [Lezer HTML
/// parser](https://github.com/lezer-parser/html), extended with the
/// JavaScript and CSS parsers to parse the content of `<script>` and
/// `<style>` tags.
export const htmlPlain = LRLanguage.define({
const htmlPlain = LRLanguage.define({
name: "html",
parser: parser.configure({
props: [
Expand Down Expand Up @@ -122,9 +118,9 @@ export function html(config: {
/// expect to only be parsing a fragment of HTML text, not a full
/// document).
matchClosingTags?: 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.
/// By default, the parser does not allow arbitrary self-closing tags.
/// Set this to `true` to turn on support for `/>` self-closing tag
/// syntax.
selfClosingTags?: boolean,
/// Determines whether [`autoCloseTags`](#lang-html.autoCloseTags)
/// is included in the support extensions. Defaults to true.
Expand Down

0 comments on commit 10335e5

Please sign in to comment.