Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MDeiml committed Jan 16, 2022
1 parent 526bea8 commit 0cced45
Show file tree
Hide file tree
Showing 5 changed files with 60,116 additions and 60,015 deletions.
23 changes: 0 additions & 23 deletions corpus/failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,26 +349,3 @@ _boolean zoop:33=zoop:33 />
(paragraph
(html_tag)))

================================================================================
Example 645 - https://github.github.com/gfm/#example-645
================================================================================
foo <!-- not a comment -- two hyphens -->

--------------------------------------------------------------------------------

(document
(paragraph))

================================================================================
Example 646 - https://github.github.com/gfm/#example-646
================================================================================
foo <!--> foo -->

foo <!-- foo--->

--------------------------------------------------------------------------------

(document
(paragraph)
(paragraph))

23 changes: 23 additions & 0 deletions corpus/spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9291,6 +9291,29 @@ comment - with hyphen -->
(paragraph
(html_tag)))

================================================================================
Example 645 - https://github.github.com/gfm/#example-645
================================================================================
foo <!-- not a comment -- two hyphens -->

--------------------------------------------------------------------------------

(document
(paragraph))

================================================================================
Example 646 - https://github.github.com/gfm/#example-646
================================================================================
foo <!--> foo -->

foo <!-- foo--->

--------------------------------------------------------------------------------

(document
(paragraph)
(paragraph))

================================================================================
Example 647 - https://github.github.com/gfm/#example-647
================================================================================
Expand Down
41 changes: 26 additions & 15 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,22 +705,33 @@ module.exports = grammar(add_inline_rules({
),
_html_comment: $ => prec.dynamic(PRECEDENCE_LEVEL_HTML, seq(
'<!--',
optional(choice(
$._word,
$._whitespace,
$._newline,
punctuation_without($, ['-', '>']),
seq(
'-',
punctuation_without($, ['>']),
)
optional(seq(
choice(
$._word,
$._whitespace,
$._newline,
punctuation_without($, ['-', '>']),
seq(
'-',
punctuation_without($, ['>']),
)
),
repeat(prec.right(choice(
$._word,
$._whitespace,
$._newline,
punctuation_without($, ['-']),
seq(
'-',
choice(
$._word,
$._whitespace,
$._newline,
punctuation_without($, ['-']),
)
)
))),
)),
repeat(prec.right(choice(
$._word,
$._whitespace,
$._newline,
punctuation_without($, []),
))),
'-->'
)),
_processing_instruction: $ => prec.dynamic(PRECEDENCE_LEVEL_HTML, seq(
Expand Down
Loading

0 comments on commit 0cced45

Please sign in to comment.