Skip to content

Commit a40cd2f

Browse files
choepplerpbodnar
authored andcommitted
fix(latex-renderer): thematic break on new line
Preceed `\hrulefill` by an empty line, so the thematic break is rendered as a separate horizontal line between blocks of text. Otherwise, the last line of the preceeding paragraph is filled with a horizontal rule. (Tested with pdflatex, version pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian))
1 parent 0b7cdf7 commit a40cd2f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mistletoe/latex_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def render_table_cell(self, token):
158158

159159
@staticmethod
160160
def render_thematic_break(token):
161-
return '\\hrulefill\n'
161+
return '\n\\hrulefill\n'
162162

163163
@staticmethod
164164
def render_line_break(token):

test/test_latex_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_table_cell(self):
120120
self._test_token('TableCell', 'inner')
121121

122122
def test_thematic_break(self):
123-
self._test_token('ThematicBreak', '\\hrulefill\n')
123+
self._test_token('ThematicBreak', '\n\\hrulefill\n')
124124

125125
def test_line_break(self):
126126
self._test_token('LineBreak', '\\newline\n', soft=False)

0 commit comments

Comments
 (0)