mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Fix nested bullet points conversion
This commit is contained in:
parent
dd96928f38
commit
c26473e6cb
2 changed files with 11 additions and 13 deletions
|
|
@ -26,12 +26,15 @@ RST_LATEST_CHANGES = re.compile(
|
|||
)
|
||||
Replacement: TypeAlias = "tuple[str, str | Callable[[re.Match[str]], str]]"
|
||||
RST_REPLACEMENTS: list[Replacement] = [
|
||||
(r"(?<=\n) {3,4}(?=\*)", " "), # fix indent of nested bullet points ...
|
||||
(r"(?<=\n) {5,6}(?=[\w:`])", " "), # ... and align wrapped text indent
|
||||
(r"(?<=[\s(])`([^`]+)`(?=[^_])", r"``\1``"), # ticks with verbatim ranges.
|
||||
(r":bug:`(\d+)`", r":bug: (#\1)"), # Issue numbers.
|
||||
(r":user:`(\w+)`", r"@\1"), # Users.
|
||||
]
|
||||
MD_REPLACEMENTS: list[Replacement] = [
|
||||
(r"^ ( *- )", r"\1"), # remove list indentation
|
||||
(r"^ (- )", r"\1"), # remove indent from top-level bullet points
|
||||
(r"^ +( - )", r"\1"), # adjust nested bullet points indent
|
||||
(r"^(\w.+?):$", r"### \1"), # make sections headers
|
||||
(r"^- `/?plugins/(\w+)`:?", r"- Plugin **`\1`**:"), # highlight plugins
|
||||
(r"^- `(\w+)-cmd`:?", r"- Command **`\1`**:"), # highlight commands
|
||||
|
|
|
|||
|
|
@ -65,19 +65,14 @@ def md_changelog():
|
|||
|
||||
### Bug fixes
|
||||
|
||||
- Some fix that refers to an issue. :bug: (\#5467)
|
||||
|
||||
- Some fix that mentions user @username.
|
||||
|
||||
- - Some fix with its own bullet points using incorrect indentation:
|
||||
|
||||
- First nested bullet point with some text that wraps to the next line
|
||||
- Second nested bullet point
|
||||
|
||||
- Another fix with its own bullet points using correct indentation:
|
||||
|
||||
- First
|
||||
- Second
|
||||
- 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:
|
||||
- First nested bullet point with some text that wraps to the next line
|
||||
- Second nested bullet point
|
||||
|
||||
### Other changes
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue