From 7e6324b7e035e2c7505d17b80eb09a759ea81491 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Mon, 12 Jul 2021 12:35:41 +0300 Subject: [PATCH 1/2] FIX: Always suffix indented code block with newline --- markdown_it/rules_block/code.py | 2 +- tests/test_port/test_no_end_newline.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/markdown_it/rules_block/code.py b/markdown_it/rules_block/code.py index ed8ad24e..6d9c87a3 100644 --- a/markdown_it/rules_block/code.py +++ b/markdown_it/rules_block/code.py @@ -29,7 +29,7 @@ def code(state: StateBlock, startLine: int, endLine: int, silent: bool = False): state.line = last token = state.push("code_block", "code", 0) - token.content = state.getLines(startLine, last, 4 + state.blkIndent, True) + token.content = state.getLines(startLine, last, 4 + state.blkIndent, False) + "\n" token.map = [startLine, state.line] return True diff --git a/tests/test_port/test_no_end_newline.py b/tests/test_port/test_no_end_newline.py index 42478dfe..b35423e1 100644 --- a/tests/test_port/test_no_end_newline.py +++ b/tests/test_port/test_no_end_newline.py @@ -17,6 +17,7 @@ ("
", ""), ("p", "p
\n"), ("[reference]: /url", ""), + (" indented code block", "indented code block\n
\n"),
],
)
def test_no_end_newline(input, expected):
From 76240feaba1b2dc98ee3e25e6d93c0957027202d Mon Sep 17 00:00:00 2001
From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
Date: Tue, 17 Aug 2021 20:43:45 +0300
Subject: [PATCH 2/2] Update port.yaml
---
markdown_it/port.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/markdown_it/port.yaml b/markdown_it/port.yaml
index d5d9b40e..499b7e38 100644
--- a/markdown_it/port.yaml
+++ b/markdown_it/port.yaml
@@ -1,7 +1,7 @@
- package: markdown-it/markdown-it
version: 12.1.0
- commit: 13cdeb95abccc78a5ce17acf9f6e8cf5b9ce713b
- date: Jul 1, 2021
+ commit: e5986bb7cca20ac95dc81e4741c08949bf01bb77
+ date: Jul 15, 2021
notes:
- Rename variables that use python built-in names, e.g.
- `max` -> `maximum`