From d300a56a8934772913dc2c3e5de598db0f7e2483 Mon Sep 17 00:00:00 2001 From: Marcos Borges <205091563+MarcosBorgesPhD@users.noreply.github.com> Date: Thu, 20 Nov 2025 21:56:56 +0100 Subject: [PATCH 1/4] Fix: Normalize Markdown links and formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert inline-code links like [`text`](url) to standard [text](url) - Correct mixed bold/code formatting: - **`code`** → `code` - `**code**` → `code` This prevents Markdown parser errors in issue bodies and ensures consistent formatting. --- scripts/auto-pr-helper.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/scripts/auto-pr-helper.py b/scripts/auto-pr-helper.py index b5454b989..02c658f49 100644 --- a/scripts/auto-pr-helper.py +++ b/scripts/auto-pr-helper.py @@ -21,6 +21,34 @@ def md_to_rst(markdown: str) -> str: return convert(markdown) +def normalize_md(issue_body: str) -> str: + """ + Fix links and mixed bold/code that confuse Markdown parser + """ + # Fix links with inline-code: [`link`](url) => [link](url) + issue_body = re.sub( + r"\[\s*`([^`]+)`\s*\]\(([^)]+)\)", + r"[\1](\2)", + issue_body + ) + + # Fix mixed bold/code formatting + # **`code`** => `code` + issue_body = re.sub( + r"\*\*`([^`]+)`\*\*", + r"`\1`", + issue_body + ) + + # `**code**` => `code` + issue_body = re.sub( + r"`\*\*([^`]+)\*\*`", + r"`\1`", + issue_body + ) + + return issue_body + def extract_form_fields(issue_body: str) -> dict: """ @@ -139,7 +167,10 @@ def format_code_block(code: str, lang: str = "rust") -> str: issue_number = json_issue["number"] issue_title = json_issue["title"] + issue_body = json_issue["body"] + issue_body = normalize_md(issue_body) + fields = extract_form_fields(issue_body) chapter = fields["chapter"] content = guideline_template(fields) From 210bf7255c4d32ba0c50bb88046f7423dda3ca72 Mon Sep 17 00:00:00 2001 From: Marcos Borges <205091563+MarcosBorgesPhD@users.noreply.github.com> Date: Fri, 21 Nov 2025 00:33:22 +0100 Subject: [PATCH 2/4] Fix: address CI failure by updating snapshot-ci.yml --- .github/workflows/snapshot-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/snapshot-ci.yml b/.github/workflows/snapshot-ci.yml index 8631545d9..a5fe40b1a 100644 --- a/.github/workflows/snapshot-ci.yml +++ b/.github/workflows/snapshot-ci.yml @@ -18,6 +18,9 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 + - name: Install Pandoc + uses: jgm/pandoc-action@v2 + - name: Run snapshot tests run: | uv run python .github/auto-pr-tests/test_runner.py From 82e2619df39b3457d574659a734a531110abfb34 Mon Sep 17 00:00:00 2001 From: Marcos Borges <205091563+MarcosBorgesPhD@users.noreply.github.com> Date: Fri, 21 Nov 2025 01:08:34 +0100 Subject: [PATCH 3/4] Fix: address CI failure by updating Pandoc installation --- .github/workflows/auto-pr-on-issue.yml | 3 +++ .github/workflows/snapshot-ci.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-pr-on-issue.yml b/.github/workflows/auto-pr-on-issue.yml index 49a836531..8c62e9e35 100644 --- a/.github/workflows/auto-pr-on-issue.yml +++ b/.github/workflows/auto-pr-on-issue.yml @@ -26,6 +26,9 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 + - name: Install Pandoc + uses: pandoc/actions/setup@v1 + - name: Set up Git run: | git config --global user.email "action@github.com" diff --git a/.github/workflows/snapshot-ci.yml b/.github/workflows/snapshot-ci.yml index a5fe40b1a..aaf73754d 100644 --- a/.github/workflows/snapshot-ci.yml +++ b/.github/workflows/snapshot-ci.yml @@ -19,7 +19,7 @@ jobs: uses: astral-sh/setup-uv@v6 - name: Install Pandoc - uses: jgm/pandoc-action@v2 + uses: pandoc/actions/setup@v1 - name: Run snapshot tests run: | From a8b0c6ab2d0c3c6c9cae273f8af18ff5bd53cc08 Mon Sep 17 00:00:00 2001 From: Marcos Borges <205091563+MarcosBorgesPhD@users.noreply.github.com> Date: Tue, 2 Dec 2025 18:51:33 +0100 Subject: [PATCH 4/4] Remove parts requested by @plaindocs Pandoc installation is only needed for PR #228, so it has been removed from this branch. --- .github/workflows/auto-pr-on-issue.yml | 3 --- .github/workflows/snapshot-ci.yml | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/auto-pr-on-issue.yml b/.github/workflows/auto-pr-on-issue.yml index 8c62e9e35..49a836531 100644 --- a/.github/workflows/auto-pr-on-issue.yml +++ b/.github/workflows/auto-pr-on-issue.yml @@ -26,9 +26,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - - name: Install Pandoc - uses: pandoc/actions/setup@v1 - - name: Set up Git run: | git config --global user.email "action@github.com" diff --git a/.github/workflows/snapshot-ci.yml b/.github/workflows/snapshot-ci.yml index aaf73754d..8631545d9 100644 --- a/.github/workflows/snapshot-ci.yml +++ b/.github/workflows/snapshot-ci.yml @@ -18,9 +18,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - - name: Install Pandoc - uses: pandoc/actions/setup@v1 - - name: Run snapshot tests run: | uv run python .github/auto-pr-tests/test_runner.py