Skip to content

Commit

Permalink
test: deal better with overlines in .rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Batchelder committed Jan 18, 2023
1 parent eca1300 commit bb242c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/scriv/format_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def parse_text(
# Section underline. Previous line was the heading.
# General RST can have overlines as well as underlines,
# which we detect because there are no previous paragraphs.
if paragraphs is None:
if paragraphs is None or paragraphs[-1] == "":
continue
# Heading was made a paragraph, undo that.
assert paragraphs[-1] == prev_line + "\n"
Expand Down
1 change: 1 addition & 0 deletions tests/test_format_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
(prelude)
===========
Section one
===========
Expand Down

0 comments on commit bb242c7

Please sign in to comment.