Skip to content

Commit

Permalink
https://github.com/jackdewinter/pymarkdown/issues/1208
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdewinter committed Nov 7, 2024
1 parent 639b47a commit 1a210d2
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 348 deletions.
8 changes: 4 additions & 4 deletions publish/coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"projectName": "pymarkdown",
"reportSource": "pytest",
"branchLevel": {
"totalMeasured": 5431,
"totalCovered": 5428
"totalMeasured": 5433,
"totalCovered": 5430
},
"lineLevel": {
"totalMeasured": 21194,
"totalCovered": 21193
"totalMeasured": 21197,
"totalCovered": 21196
}
}

2 changes: 1 addition & 1 deletion publish/test-results.json
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@
},
{
"name": "test.rules.test_md012",
"totalTests": 12,
"totalTests": 15,
"failedTests": 0,
"errorTests": 0,
"skippedTests": 0,
Expand Down
6 changes: 6 additions & 0 deletions pymarkdown/plugins/rule_md_012.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ def next_token(self, context: PluginScanContext, token: MarkdownToken) -> None:
Event that a new token is being processed.
"""
if token.is_blank_line:
if (
self.__last_blank_line is not None
and (token.line_number - self.__last_blank_line.line_number) != 1
):
self.__check_for_excess_blank_lines(context)
self.__blank_line_count = 0
self.__last_blank_line = token
self.__blank_line_count += 1
else:
Expand Down
Loading

0 comments on commit 1a210d2

Please sign in to comment.