Skip to content

Scope markdown 4-backtick fence rule to true nested-fence cases#26506

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-markdown-4-backtick-rule
Apr 15, 2026
Merged

Scope markdown 4-backtick fence rule to true nested-fence cases#26506
pelikhan merged 2 commits intomainfrom
copilot/fix-markdown-4-backtick-rule

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

The markdown guidance was too broad and caused models to emit 4-backtick fences for standalone blocks (e.g., mermaid), which breaks GitHub rendering. This change narrows the rule so 4-backticks are only used when block content literally includes triple-backtick fences.

  • Problem refinement

    • Reworded the markdown generation rule in actions/setup/md/markdown.md to remove ambiguous “outer nested code block” interpretation.
    • Added explicit conditional behavior: 4-backticks only for literal embedded fences; otherwise use standard fences.
  • Prompt contract update

    • Kept GitHub Flavored Markdown requirement unchanged.
    • Clarified fence selection behavior in one sentence to reduce partial/incorrect fence upgrades (e.g., opening-only changes).
<markdown-generation>
<rule>Only use 4-backtick fences when the block literally contains triple-backtick fences inside it; otherwise use standard 3-backtick fences. Use GitHub Flavored Markdown.</rule>
</markdown-generation>

Copilot AI changed the title [WIP] Fix over-application of 4-backtick rule for code blocks Scope markdown 4-backtick fence rule to true nested-fence cases Apr 15, 2026
Copilot AI requested a review from pelikhan April 15, 2026 22:53
@pelikhan pelikhan marked this pull request as ready for review April 15, 2026 23:00
Copilot AI review requested due to automatic review settings April 15, 2026 23:00
@pelikhan pelikhan merged commit 3ceca2a into main Apr 15, 2026
53 checks passed
@pelikhan pelikhan deleted the copilot/fix-markdown-4-backtick-rule branch April 15, 2026 23:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Narrows the markdown fence selection guidance so models only emit 4-backtick fences when a code block literally contains embedded triple-backtick fences, avoiding GitHub rendering issues for standalone fenced blocks (e.g., mermaid).

Changes:

  • Replaced the overly broad “outer blocks containing nested code blocks” guidance with an explicit conditional rule for when to use 4-backtick vs 3-backtick fences.
Show a summary per file
File Description
actions/setup/md/markdown.md Refines the markdown-generation rule to use 4-backtick fences only for true literal nested-fence cases.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

This was referenced Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown.md 4-backtick rule is over-applied to standalone code blocks (e.g. mermaid)

3 participants