Skip to content

🐛 FIX: Always suffix indented code block with newline #169

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions markdown_it/port.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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