From 558b8e6ffd3e1b53a64ec7afb7244c062b5159e1 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 3 Mar 2021 12:31:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20empty=20lines=20after=20b?= =?UTF-8?q?lockquote+footnote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- markdown_it/parser_block.py | 6 ++--- tests/test_plugins/fixtures/footnote.md | 30 ++++++++++++++++++++++++- tox.ini | 4 +++- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/markdown_it/parser_block.py b/markdown_it/parser_block.py index 04d70334..dd002354 100644 --- a/markdown_it/parser_block.py +++ b/markdown_it/parser_block.py @@ -81,12 +81,12 @@ def tokenize( # i.e. latest empty line should not count state.tight = not hasEmptyLines + line = state.line + # paragraph might "eat" one newline after it in nested lists - if state.isEmpty(state.line - 1): + if (line - 1) < endLine and state.isEmpty(line - 1): hasEmptyLines = True - line = state.line - if line < endLine and state.isEmpty(line): hasEmptyLines = True line += 1 diff --git a/tests/test_plugins/fixtures/footnote.md b/tests/test_plugins/fixtures/footnote.md index 7ffeb8bf..cfc7ee3b 100644 --- a/tests/test_plugins/fixtures/footnote.md +++ b/tests/test_plugins/fixtures/footnote.md @@ -297,4 +297,32 @@ hij

↩︎ -. \ No newline at end of file +. + +issue-133 +. +> b [^1] + +Some text + +> c + +[^1]: d + + +. +
+

b [1]

+
+

Some text

+
+

c

+
+
+
+
    +
  1. d ↩︎

    +
  2. +
+
+. diff --git a/tox.ini b/tox.ini index 34ae106a..855aa8e6 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,9 @@ envlist = py37 usedevelop = true [testenv:py{36,37,38}] -extras = testing +extras = + linkify + testing commands = pytest {posargs} [testenv:py{36,37,38}-bench-core]