Fix wrapped line starting with the username role

This commit is contained in:
Šarūnas Nejus 2024-12-04 02:35:50 +00:00
parent 89afb8cd89
commit 806c1702fb
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
2 changed files with 5 additions and 6 deletions

View file

@ -30,7 +30,7 @@ RST_REPLACEMENTS: list[Replacement] = [
(r"(?<=\n) {5,6}(?=[\w:`])", " "), # ... and align wrapped text indent (r"(?<=\n) {5,6}(?=[\w:`])", " "), # ... and align wrapped text indent
(r"(?<=[\s(])`([^`]+)`(?=[^_])", r"``\1``"), # ticks with verbatim ranges. (r"(?<=[\s(])`([^`]+)`(?=[^_])", r"``\1``"), # ticks with verbatim ranges.
(r":bug:`(\d+)`", r":bug: (#\1)"), # Issue numbers. (r":bug:`(\d+)`", r":bug: (#\1)"), # Issue numbers.
(r":user:`(\w+)`", r"@\1"), # Users. (r":user:`(\w+)`", r"\@\1"), # Users.
] ]
MD_REPLACEMENTS: list[Replacement] = [ MD_REPLACEMENTS: list[Replacement] = [
(r"^ (- )", r"\1"), # remove indent from top-level bullet points (r"^ (- )", r"\1"), # remove indent from top-level bullet points
@ -127,6 +127,7 @@ def rst2md(text: str) -> str:
def get_changelog_contents() -> str | None: def get_changelog_contents() -> str | None:
return CHANGELOG.read_text()
if m := RST_LATEST_CHANGES.search(CHANGELOG.read_text()): if m := RST_LATEST_CHANGES.search(CHANGELOG.read_text()):
return m.group(1) return m.group(1)

View file

@ -67,14 +67,12 @@ def md_changelog():
### Bug fixes ### Bug fixes
- Some fix thanks to
- Some fix that mentions user @username.
- Some fix that refers to an issue. :bug: (\#5467)
1. - bug
(\#5467)
- Another fix with its own bullet points using correct indentation: - Another fix with its own bullet points using correct indentation:
- First - First
- Second - Second
- Some fix thanks to @username. :bug: (\#5467)
- Some fix that mentions user @username.
- Some fix that refers to an issue. :bug: (\#5467)
- Some fix with its own bullet points using incorrect indentation: - Some fix with its own bullet points using incorrect indentation:
- First nested bullet point with some text that wraps to the next line - First nested bullet point with some text that wraps to the next line
- Second nested bullet point - Second nested bullet point