Skip to content

Commit

Permalink
Handle Markdown URLs when displaying release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhinham committed Mar 26, 2022
1 parent a2f4da4 commit c388268
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/mt32pi_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def show_release_notes(release_info):
text = release_info['body']

# Poor man's Markdown formatting
text = re.sub(r"\[(.+?)\]\(.+?\)", rf"{COLOR_PURPLE}\1{COLOR_RESET}", text, flags=re.MULTILINE)
text = re.sub(r"^#+\s*(.+)$", rf"{COLOR_GREEN}\1{COLOR_RESET}", text, flags=re.MULTILINE)
text = re.sub(r"^(\s*)-(.+)$", rf"\1{COLOR_PURPLE}-{COLOR_RESET}\2", text, flags=re.MULTILINE)
text = re.sub(r"^(\s*)\*(.+)$", rf"\1{COLOR_PURPLE}*{COLOR_RESET}\2", text, flags=re.MULTILINE)
Expand Down

0 comments on commit c388268

Please sign in to comment.