From da515e6f957d2b7e264ebb50615c1b1e56c87afa Mon Sep 17 00:00:00 2001 From: PhuNH <1079742+PhuNH@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:49:16 +0200 Subject: [PATCH] Add a blank line between a paragraph and an HTML block --- mdit_py_i18n/renderer_l10n.py | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mdit_py_i18n/renderer_l10n.py b/mdit_py_i18n/renderer_l10n.py index fa1fcf1..ab520c5 100644 --- a/mdit_py_i18n/renderer_l10n.py +++ b/mdit_py_i18n/renderer_l10n.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 564d681..5181919 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "LGPL-2.1-or-later"