@willbooster/tree-sitter-markdown 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,7 @@ digits of an ordered list marker with `'0'` and `'9'` instead of calling `isdigi
19
19
  own ABI number (`0x57420001`) and load only with that fork's runtime, version 2.0.0 or later: upstream's tree-sitter
20
20
  runtime rejects them. They parse as the parsers in upstream's 0.5.3 packages do, with these exceptions:
21
21
 
22
+ - HTML declarations end on the first line containing `>`, leaving subsequent Markdown outside the HTML block.
22
23
  - Short HTML comments such as `<!-->` and `<!--->` end on their opening line. Malformed `<!-` prefixes remain ordinary text.
23
24
  - Block containers nest to a maximum depth of 255. Additional quote, list, code, or HTML block openers remain literal text inside the deepest container.
24
25
  - Final headings, thematic breaks, empty list items, and opening code fences are recognized without a trailing newline.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-markdown",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Markdown grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -221,7 +221,7 @@ module.exports = grammar({
221
221
  ),
222
222
  _html_block_2: $ => build_html_block($, $._html_block_2_start, '-->', true),
223
223
  _html_block_3: $ => build_html_block($, $._html_block_3_start, '?>', true),
224
- _html_block_4: $ => build_html_block($, $._html_block_4_start, '>', true),
224
+ _html_block_4: $ => build_html_block($, $._html_block_4_start, '>', true, $._declaration_line),
225
225
  _html_block_5: $ => build_html_block($, $._html_block_5_start, ']]>', true),
226
226
  _html_block_6: $ => build_html_block(
227
227
  $,
@@ -390,6 +390,7 @@ module.exports = grammar({
390
390
  optional($.block_continuation)
391
391
  ),
392
392
  // Some symbols get parsed as single tokens so that html blocks get detected properly
393
+ _declaration_line: $ => prec.right(repeat1(choice($._word, $._whitespace, common.punctuation_without($, ['>'])))),
393
394
  _line: $ => prec.right(repeat1(choice($._word, $._whitespace, common.punctuation_without($, [])))),
394
395
  _word: $ => choice(
395
396
  new RegExp('[^' + PUNCTUATION_CHARACTERS_REGEX + ' \\t\\n\\r]+'),
@@ -599,11 +600,11 @@ module.exports = grammar({
599
600
  // General purpose structure for html blocks. The different kinds mostly work the same but have
600
601
  // different openling and closing conditions. Some html blocks may not interrupt a paragraph and
601
602
  // have to be marked as such.
602
- function build_html_block($, open, close, interrupt_paragraph) {
603
+ function build_html_block($, open, close, interrupt_paragraph, line = $._line) {
603
604
  return seq(
604
605
  open,
605
606
  repeat(choice(
606
- $._line,
607
+ line,
607
608
  $._newline,
608
609
  seq(close, $._close_block),
609
610
  )),
Binary file
Binary file
package/tree-sitter.json CHANGED
@@ -30,7 +30,7 @@
30
30
  }
31
31
  ],
32
32
  "metadata": {
33
- "version": "1.0.5",
33
+ "version": "1.0.6",
34
34
  "license": "MIT",
35
35
  "description": "Markdown grammar for tree-sitter",
36
36
  "authors": [