Skip to content

Commit

Permalink
Really fix the handling of HTML block after a paragraph
Browse files Browse the repository at this point in the history
paragraph_close of hugo-gettext overrides that of mdit-py-i18n
  • Loading branch information
PhuNH committed Sep 26, 2023
1 parent e28e790 commit 950444d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions hugo_gettext/generation/renderer_hugo_l10n.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def paragraph_close(cls, tokens: Sequence[Token], idx: int, md_ctx: MdCtx, conte
cls._attributes(token, md_ctx, content_result)
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'

@classmethod
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 = "hugo-gettext"
version = "0.5.2"
version = "0.5.3"
description = "I18n with gettext for Hugo"
authors = ["Phu Hung Nguyen <[email protected]>"]
license = "LGPL-2.1-or-later"
Expand Down

0 comments on commit 950444d

Please sign in to comment.