Skip to content
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
9 changes: 7 additions & 2 deletions markdown_it/rules_block/blockquote.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,21 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
# set offset past spaces and ">"
initial = offset = state.sCount[nextLine] + 1

try:
next_char: Optional[int] = state.srcCharCode[pos]
except IndexError:
next_char = None

# skip one optional space after '>'
if state.srcCharCode[pos] == 0x20: # /* space */
if next_char == 0x20: # /* space */
# ' > test '
# ^ -- position start of line here:
pos += 1
initial += 1
offset += 1
adjustTab = False
spaceAfterMarker = True
elif state.srcCharCode[pos] == 0x09: # /* tab */
elif next_char == 0x09: # /* tab */
spaceAfterMarker = True

if (state.bsCount[nextLine] + offset) % 4 == 3:
Expand Down
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 @@ -18,6 +18,7 @@
("p", "<p>p</p>\n"),
("[reference]: /url", ""),
(" indented code block", "<pre><code>indented code block\n</code></pre>\n"),
("> test\n>", "<blockquote>\n<p>test</p>\n</blockquote>\n"),
],
)
def test_no_end_newline(input, expected):
Expand Down