Browse Source

Lower priority for ATX headers to resolve conflict with HTML blocks

fix https://github.com/markdown-it/markdown-it/issues/772
pull/775/head
Alex Kocharin 4 years ago
parent
commit
309c03a9e8
  1. 5
      CHANGELOG.md
  2. 2
      lib/parser_block.js
  3. 18
      test/fixtures/markdown-it/commonmark_extras.txt

5
CHANGELOG.md

@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [12.0.5] - WIP
### Fixed
- HTML block tags with `===` inside are no longer incorrectly interpreted as headers, #772.
## [12.0.4] - 2020-12-20 ## [12.0.4] - 2020-12-20
### Fixed ### Fixed
- Fix crash introduced in `12.0.3` when processing strikethrough (`~~`) and similar plugins, #742. - Fix crash introduced in `12.0.3` when processing strikethrough (`~~`) and similar plugins, #742.

2
lib/parser_block.js

@ -19,9 +19,9 @@ var _rules = [
[ 'hr', require('./rules_block/hr'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ], [ 'hr', require('./rules_block/hr'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
[ 'list', require('./rules_block/list'), [ 'paragraph', 'reference', 'blockquote' ] ], [ 'list', require('./rules_block/list'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'reference', require('./rules_block/reference') ], [ 'reference', require('./rules_block/reference') ],
[ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'heading', require('./rules_block/heading'), [ 'paragraph', 'reference', 'blockquote' ] ], [ 'heading', require('./rules_block/heading'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'lheading', require('./rules_block/lheading') ], [ 'lheading', require('./rules_block/lheading') ],
[ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'paragraph', require('./rules_block/paragraph') ] [ 'paragraph', require('./rules_block/paragraph') ]
]; ];

18
test/fixtures/markdown-it/commonmark_extras.txt

@ -635,3 +635,21 @@ baz</p>
</blockquote> </blockquote>
</blockquote> </blockquote>
. .
Issue #772. Header rule should not interfere with html tags.
.
<!--
==
-->
<pre>
==
</pre>
.
<!--
==
-->
<pre>
==
</pre>
.

Loading…
Cancel
Save