From 22d07e59296c0f20d6c12939649d520f23cd86c6 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Tue, 9 Aug 2022 02:06:15 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20Parsing=20when=20newline?= =?UTF-8?q?=20is=20between=20footnote=20ID=20and=20first=20paragraph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdit_py_plugins/footnote/index.py | 2 +- tests/fixtures/footnote.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mdit_py_plugins/footnote/index.py b/mdit_py_plugins/footnote/index.py index 0ddd314..119fb71 100644 --- a/mdit_py_plugins/footnote/index.py +++ b/mdit_py_plugins/footnote/index.py @@ -80,7 +80,7 @@ def footnote_def(state: StateBlock, startLine: int, endLine: int, silent: bool): if pos == start + 2: # no empty footnote labels return False pos += 1 - if pos + 1 >= maximum or state.srcCharCode[pos] != 0x3A: # /* : */ + if pos >= maximum or state.srcCharCode[pos] != 0x3A: # /* : */ return False if silent: return True diff --git a/tests/fixtures/footnote.md b/tests/fixtures/footnote.md index b59dd4a..b0643e1 100644 --- a/tests/fixtures/footnote.md +++ b/tests/fixtures/footnote.md @@ -326,3 +326,21 @@ Some text . + + +Newline after footnote identifier +. +[^a] + +[^a]: +b +. +

[1]

+

b

+
+
+
    +
  1. <-
  2. +
+
+.