Merge pull request #6020 from dhalbert/convert-release-notes-update

Fix and revise convert-release-notes.py
This commit is contained in:
Scott Shawcroft 2022-02-13 18:36:30 -08:00 committed by GitHub
commit 306852d33f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,9 +16,8 @@ html = mistune.create_markdown()
print()
print("HTML")
print("=====================================")
print('From the <a href="">GitHub release page</a>:\n<blockquote>')
print('<p><em>From the <a href="">GitHub release page</a>:</em></p>\n')
print(html(source))
print("</blockquote>")
class AdafruitBBCodeRenderer(mistune.renderers.BaseRenderer):
@ -59,10 +58,13 @@ class AdafruitBBCodeRenderer(mistune.renderers.BaseRenderer):
return "[b]{}[/b]".format(text)
def emphasis(self, text):
return "[b]{}[/b]".format(text)
return "[i]{}[/i]".format(text)
def strong(self, text):
return "[i]{}[/i]".format(text)
return "[b]{}[/b]".format(text)
def finalize(self, data):
return "".join(data)
bbcode = mistune.create_markdown(renderer=AdafruitBBCodeRenderer())
@ -70,6 +72,5 @@ bbcode = mistune.create_markdown(renderer=AdafruitBBCodeRenderer())
print()
print("BBCode")
print("=====================================")
print("From the [url=]GitHub release page[/url]:\n[quote]")
print("[i]From the [url=]GitHub release page[/url]:[/i]\n")
print(bbcode(source))
print("[/quote]")