Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 FIX: Always suffix indented code block with newline #169

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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