Skip to content

Commit

Permalink
Fix release formatting for new versions of pandoc
Browse files Browse the repository at this point in the history
Ubuntu version in GitHub Actions has recently been upgraded to 24.04:
  actions/runner-images#10636)

This meant that pandoc was upgraded and it changed the way markdown is
formatted by default.
  • Loading branch information
snejus committed Jan 13, 2025
1 parent 5fc92c9 commit 0a53a93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions extra/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ def make_ref_link(ref_id: str, name: str | None = None) -> str:


MD_REPLACEMENTS: list[Replacement] = [
(r"^ (- )", r"\1"), # remove indent from top-level bullet points
(r"^ +( - )", r"\1"), # adjust nested bullet points indent
(r"<span[^>]+>([^<]+)</span>", r"_\1"), # remove a couple of wild span refs
(r"^(\w[^\n]{,80}):(?=\n\n[^ ])", r"### \1"), # format section headers
(r"^(\w[^\n]{81,}):(?=\n\n[^ ])", r"**\1**"), # and bolden too long ones
(r"### [^\n]+\n+(?=### )", ""), # remove empty sections
Expand Down
8 changes: 4 additions & 4 deletions test/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def rst_changelog():
def md_changelog():
return r"""### New features
- [Substitute Plugin](https://beets.readthedocs.io/en/stable/plugins/substitute.html): Some substitute multi-line change. :bug: (\#5467)
- [Substitute Plugin](https://beets.readthedocs.io/en/stable/plugins/substitute.html): Some substitute multi-line change. :bug: (#5467)
- [list](https://beets.readthedocs.io/en/stable/reference/cli.html#list-cmd) Update.
You can do something with this command:
Expand All @@ -82,9 +82,9 @@ def md_changelog():
- Another fix with its own bullet points using correct indentation:
- First
- Second
- Some fix thanks to @username. :bug: (\#5467)
- Some fix thanks to @username. :bug: (#5467)
- Some fix that mentions user @username.
- Some fix that refers to an issue. :bug: (\#5467)
- 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
Expand All @@ -93,7 +93,7 @@ def md_changelog():
### Other changes
- Changed `bitesize` label to `good first issue`. Our [contribute](https://github.com/beetbox/beets/contribute) page is now automatically populated with these issues. :bug: (\#4855)
- Changed `bitesize` label to `good first issue`. Our [contribute](https://github.com/beetbox/beets/contribute) page is now automatically populated with these issues. :bug: (#4855)
# 2.1.0 (November 22, 2024)
Expand Down

0 comments on commit 0a53a93

Please sign in to comment.