Skip to content

Commit

Permalink
馃悰 FIX: Always suffix indented code block with newline (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
hukkin committed Dec 1, 2021
1 parent 0195be3 commit 22a65b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 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`
Expand Down
2 changes: 1 addition & 1 deletion markdown_it/rules_block/code.py
Expand Up @@ -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
1 change: 1 addition & 0 deletions tests/test_port/test_no_end_newline.py
Expand Up @@ -17,6 +17,7 @@
("<h1></h1>", "<h1></h1>"),
("p", "<p>p</p>\n"),
("[reference]: /url", ""),
(" indented code block", "<pre><code>indented code block\n</code></pre>\n"),
],
)
def test_no_end_newline(input, expected):
Expand Down

0 comments on commit 22a65b3

Please sign in to comment.