Skip to content

Commit 02a8bbf

Browse files
committed
Fix formatting.md.jinja separator newline escaping
1 parent e5300c9 commit 02a8bbf

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Pydantic's HISTORY.md](https://github.com/pydantic/pydantic/blob/main/HISTORY.md), and this project *mostly* adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## `1!0.1.0a30`
8+
9+
### Fixed
10+
11+
* Fixed Markdown newlines being incorrectly escaped in some cases.
12+
713
## `1!0.1.0a29`
814

915
### Fixed

src/hexdoc/_templates/macros/formatting.md.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{ fmt_base.styled(
77
value,
88
safe=safe,
9-
separator="\\n"|safe,
9+
separator="\n"|safe,
1010
styles=styles_md,
1111
) }}
1212
{%- endmacro %}

test/patchouli/test_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def hexdoc_block(value: FormatTree, ext: str = "html"):
6060

6161
def test_markdown_escape():
6262
tree = format_with_mocks(
63-
"all ↗ makes the result $(bold)* 2 + 1/$, all → makes it $(bold)* 2/$, and all ↘ for $(bold)/ 10/$."
63+
"all ↗ makes the result $(bold)* 2 + 1/$,$(br)all → makes it $(bold)* 2/$,$(br2)and all ↘ for $(bold)/ 10/$."
6464
)
6565
assert (
6666
hexdoc_block(tree, "md")
67-
== "all ↗ makes the result **\\* 2 + 1**, all → makes it **\\* 2**, and all ↘ for **/ 10**.\n"
67+
== "all ↗ makes the result **\\* 2 + 1**,\nall → makes it **\\* 2**,\nand all ↘ for **/ 10**.\n"
6868
)
6969

7070

0 commit comments

Comments
 (0)