diff --git a/misc/gen_blog_post_html.py b/misc/gen_blog_post_html.py
index a0156bee50dc..e4bfd391a009 100644
--- a/misc/gen_blog_post_html.py
+++ b/misc/gen_blog_post_html.py
@@ -104,6 +104,7 @@ def convert(src: str) -> str:
h = format_code(h)
# Code fragments
+ h = re.sub(r"``([^`]+)``", r"\1", h)
h = re.sub(r"`([^`]+)`", r"\1", h)
# Remove **** noise
@@ -125,7 +126,9 @@ def convert(src: str) -> str:
r'fixes issue \1',
h,
)
- h = re.sub(r"#([0-9]+)", r'PR \1', h)
+ # Note the leading space to avoid stomping on strings that contain #\d in the middle (such as
+ # links to PRs in other repos)
+ h = re.sub(r" #([0-9]+)", r'PR \1', h)
h = re.sub(r"\) \(PR", ", PR", h)
# Markdown links