Skip to content

Commit 2ec0abd

Browse files
committed
Fix a porting typo, causing infinite while loop for footnote blocks
1 parent fe94b55 commit 2ec0abd

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

markdown_it/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .main import MarkdownIt # noqa: F401
22

33

4-
__version__ = "0.2.3"
4+
__version__ = "0.3.0"

markdown_it/cli/benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def run_all(package_names, path, num_parses):
9191
print(prompt)
9292
print("=" * len(prompt))
9393
max_len = max(len(p) for p in package_names)
94-
text = text = path.read_text()
94+
text = path.read_text()
9595
for package_name in package_names:
9696
print(package_name + " " * (max_len - len(package_name)), end=" ")
9797
func_name = re.sub(r"[\.\-\:]", "_", package_name.lower())

markdown_it/parser_block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def tokenize(
7474
# - update `state.tokens`
7575
# - return True
7676
for rule in rules:
77-
if rule(state, line, endLine, silent):
77+
if rule(state, line, endLine, False):
7878
break
7979

8080
# set state.tight if we had an empty line before current tag

tests/test_footnote/fixtures.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,37 @@ Example^[this is another example https://github.com]
264264
</ol>
265265
</section>
266266
.
267+
268+
Nested blocks:
269+
.
270+
[^a]
271+
272+
[^a]: abc
273+
274+
def
275+
hij
276+
277+
- list
278+
279+
> block
280+
281+
terminates here
282+
.
283+
<p><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup></p>
284+
<p>terminates here</p>
285+
<hr class="footnotes-sep">
286+
<section class="footnotes">
287+
<ol class="footnotes-list">
288+
<li id="fn1" class="footnote-item"><p>abc</p>
289+
<p>def
290+
hij</p>
291+
<ul>
292+
<li>list</li>
293+
</ul>
294+
<blockquote>
295+
<p>block</p>
296+
</blockquote>
297+
<a href="#fnref1" class="footnote-backref">↩︎</a></li>
298+
</ol>
299+
</section>
300+
.

0 commit comments

Comments
 (0)