From 309c03a9e856ad5f39ea5e7c066198a93b9331fb Mon Sep 17 00:00:00 2001
From: Alex Kocharin
Date: Mon, 12 Apr 2021 17:06:17 +0300
Subject: [PATCH] Lower priority for ATX headers to resolve conflict with HTML
blocks
fix https://github.com/markdown-it/markdown-it/issues/772
---
CHANGELOG.md | 5 +++++
lib/parser_block.js | 2 +-
.../fixtures/markdown-it/commonmark_extras.txt | 18 ++++++++++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d726388a9..2b0049be8 100644
--- a/CHANGELOG.md
+++ b/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).
+## [12.0.5] - WIP
+### Fixed
+- HTML block tags with `===` inside are no longer incorrectly interpreted as headers, #772.
+
+
## [12.0.4] - 2020-12-20
### Fixed
- Fix crash introduced in `12.0.3` when processing strikethrough (`~~`) and similar plugins, #742.
diff --git a/lib/parser_block.js b/lib/parser_block.js
index 10505c746..5450c2aba 100644
--- a/lib/parser_block.js
+++ b/lib/parser_block.js
@@ -19,9 +19,9 @@ var _rules = [
[ 'hr', require('./rules_block/hr'), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
[ 'list', require('./rules_block/list'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'reference', require('./rules_block/reference') ],
+ [ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'heading', require('./rules_block/heading'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'lheading', require('./rules_block/lheading') ],
- [ 'html_block', require('./rules_block/html_block'), [ 'paragraph', 'reference', 'blockquote' ] ],
[ 'paragraph', require('./rules_block/paragraph') ]
];
diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt
index c2c9caa89..f603271b5 100644
--- a/test/fixtures/markdown-it/commonmark_extras.txt
+++ b/test/fixtures/markdown-it/commonmark_extras.txt
@@ -635,3 +635,21 @@ baz
.
+
+Issue #772. Header rule should not interfere with html tags.
+.
+
+
+
+==
+
+.
+
+
+==
+
+.