Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdewinter authored Jan 12, 2025
1 parent 929207b commit b22b532
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 1,318 deletions.
4 changes: 3 additions & 1 deletion newdocs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<!--- pyml disable-next-line no-duplicate-heading-->
### Fixed

- None
- [Issue 1302](https://github.com/jackdewinter/pymarkdown/issues/1302)
- reported issue where `C\#` at the end of a header was triggering
rule Md020 for no spaces between end mark of an Atx Heading

<!--- pyml disable-next-line no-duplicate-heading-->
### Changed
Expand Down
4 changes: 2 additions & 2 deletions publish/test-results.json
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@
},
{
"name": "test.rules.test_md020",
"totalTests": 36,
"totalTests": 40,
"failedTests": 0,
"errorTests": 0,
"skippedTests": 0,
Expand Down Expand Up @@ -1620,7 +1620,7 @@
},
{
"name": "test.test_markdown_extra",
"totalTests": 315,
"totalTests": 317,
"failedTests": 0,
"errorTests": 0,
"skippedTests": 11,
Expand Down
4 changes: 3 additions & 1 deletion pymarkdown/plugins/rule_md_020.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def next_token(self, context: PluginScanContext, token: MarkdownToken) -> None:
assert self.__last_atx_token is not None
if self.__is_in_normal_atx and self.__last_atx_token.is_text:
text_token = cast(TextMarkdownToken, self.__last_atx_token)
if text_token.token_text.endswith("#"):
if text_token.token_text.endswith(
"#"
) and not text_token.token_text.endswith("\\\b#"):
regex_match = re.search(r"\#+$", text_token.token_text)
assert regex_match is not None
self.report_next_token_error(
Expand Down
Loading

0 comments on commit b22b532

Please sign in to comment.