Skip to content

Commit 1977a0a

Browse files
committed
Make line block lines look like how I want
1 parent fb8356a commit 1977a0a

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

sample/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,12 @@ Line Blocks
357357

358358
The builder supports line blocks using pipe characters to preserve line breaks:
359359

360+
Nothing in between
361+
362+
|
363+
364+
Now something in between
365+
360366
| This is a line block
361367
| with multiple lines
362368
| preserved exactly as written

src/sphinx_notion/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _(child: nodes.line) -> Text:
231231
"""
232232
Process line nodes by creating rich text.
233233
"""
234-
return _create_styled_text_from_node(child=child)
234+
return _create_styled_text_from_node(child=child) + "\n"
235235

236236

237237
@beartype

tests/test_integration.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,9 +3094,14 @@ def test_line_block(
30943094
"""
30953095

30963096
expected_objects: list[Block] = [
3097-
UnoParagraph(text=text(text="This is a line block")),
3098-
UnoParagraph(text=text(text="with multiple lines")),
3099-
UnoParagraph(text=text(text="preserved exactly as written")),
3097+
UnoParagraph(
3098+
text=text(text="This is a line block")
3099+
+ text(text="\n")
3100+
+ text(text="with multiple lines")
3101+
+ text(text="\n")
3102+
+ text(text="preserved exactly as written")
3103+
+ text(text="\n")
3104+
),
31003105
]
31013106

31023107
_assert_rst_converts_to_notion_objects(

0 commit comments

Comments
 (0)