mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 00:24:25 +01:00
Ignore literal code blocks when making headers
This commit is contained in:
parent
6d602effc3
commit
0b905e1b17
2 changed files with 3 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ RST_REPLACEMENTS: list[Replacement] = [
|
|||
MD_REPLACEMENTS: list[Replacement] = [
|
||||
(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"^(\w[^\n]+):(?=\n\n[^ ])", r"### \1"), # make sections headers
|
||||
(r"^- `/?plugins/(\w+)`:?", r"- Plugin **`\1`**:"), # highlight plugins
|
||||
(r"^- `(\w+)-cmd`:?", r"- Command **`\1`**:"), # highlight commands
|
||||
(r"### [^\n]+\n+(?=### )", ""), # remove empty sections
|
||||
|
|
@ -142,7 +142,7 @@ def changelog_as_markdown(rst: str) -> str:
|
|||
md = rst2md(rst)
|
||||
|
||||
for pattern, repl in MD_REPLACEMENTS:
|
||||
md = re.sub(pattern, repl, md, flags=re.M)
|
||||
md = re.sub(pattern, repl, md, flags=re.M | re.DOTALL)
|
||||
|
||||
# order bullet points in each of the lists alphabetically to
|
||||
# improve readability
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ def md_changelog():
|
|||
- Command **`list`**: Update.
|
||||
- Plugin **`substitute`**: Some substitute multi-line change. :bug: (\#5467)
|
||||
|
||||
### You can do something with this command::
|
||||
You can do something with this command:
|
||||
|
||||
$ do-something
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue