Skip to content

Commit

Permalink
Add a blank line between a paragraph and an HTML block
Browse files Browse the repository at this point in the history
  • Loading branch information
PhuNH committed Sep 26, 2023
1 parent 3316646 commit da515e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mdit_py_i18n/renderer_l10n.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ def paragraph_close(cls, tokens: Sequence[Token], idx: int, md_ctx: MdCtx, conte
content_result.localized += '\n'
if idx < len(tokens) - 1:
next_token = tokens[idx + 1]
# add a blank line when next token is a setext heading_open, an indented code block, a paragraph open,
# or a definition list open
# add a blank line when next token is a setext heading_open, an HTML block, an indented code block,
# a paragraph open, or a definition list open
if (next_token.type == 'heading_open' and next_token.markup in SETEXT_HEADING_MARKUPS) \
or next_token.type in {'code_block', 'paragraph_open', 'dl_open'}:
or next_token.type in {'code_block', 'html_block', 'paragraph_open', 'dl_open'}:
content_result.localized += f'{md_ctx.line_indent}\n'

# indented code block
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[tool.poetry]
name = "mdit-py-i18n"
version = "0.1.2"
version = "0.1.3"
description = "Markdown i18n and l10n using markdown-it-py"
authors = ["Phu Hung Nguyen <[email protected]>"]
license = "LGPL-2.1-or-later"
Expand Down

0 comments on commit da515e6

Please sign in to comment.