diff --git a/misc/gen_blog_post_html.py b/misc/gen_blog_post_html.py index 847e053996549..1c2d876486049 100644 --- a/misc/gen_blog_post_html.py +++ b/misc/gen_blog_post_html.py @@ -95,7 +95,7 @@ def convert(src: str) -> str: h = re.sub(r"`\*\*`", "**", h) # Paragraphs - h = re.sub(r"\n([A-Z])", r"\n
\1", h) + h = re.sub(r"\n\n([A-Z])", r"\n\n
\1", h) # Bullet lists h = format_lists(h) @@ -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