From 0a065e40527790fc06284d87c9fe6ce1b4f04b30 Mon Sep 17 00:00:00 2001 From: Wesley Collin Wright Date: Tue, 4 Feb 2025 23:57:52 +0000 Subject: [PATCH 1/3] [misc] fix spurious newlines generated by gen_blog_post_html.py --- misc/gen_blog_post_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/gen_blog_post_html.py b/misc/gen_blog_post_html.py index 847e053996549..a0156bee50dca 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) From 5092d649d17e19d706ba61445f077236975faa77 Mon Sep 17 00:00:00 2001 From: Wesley Collin Wright Date: Wed, 5 Feb 2025 04:35:51 +0000 Subject: [PATCH 2/3] also fix multiple consecutive backticks & r"#\d" in the middle of words --- misc/gen_blog_post_html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/gen_blog_post_html.py b/misc/gen_blog_post_html.py index a0156bee50dca..e4bfd391a0099 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 From fb2f37c6ca6d6dd316099cea24ae2da76933ecb8 Mon Sep 17 00:00:00 2001 From: Wesley Collin Wright Date: Wed, 5 Feb 2025 14:35:10 +0000 Subject: [PATCH 3/3] add back the whietspace character that we eat --- misc/gen_blog_post_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/gen_blog_post_html.py b/misc/gen_blog_post_html.py index e4bfd391a0099..1c2d876486049 100644 --- a/misc/gen_blog_post_html.py +++ b/misc/gen_blog_post_html.py @@ -128,7 +128,7 @@ def convert(src: str) -> str: ) # 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" #([0-9]+)", r' PR \1', h) h = re.sub(r"\) \(PR", ", PR", h) # Markdown links