Skip to content

Fix inline callout regex and li rendering for markdown links#3355

Merged
Mpdreamz merged 1 commit into
mainfrom
fix/inline-callout-regex-and-rendering
May 19, 2026
Merged

Fix inline callout regex and li rendering for markdown links#3355
Mpdreamz merged 1 commit into
mainfrom
fix/inline-callout-regex-and-rendering

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

Why

PR #3324 added support for inline Markdown in automatic callouts, but CI started failing on main after merge. The MathInlineAnnotation regex excluded / from callout comment text, so any comment containing a link (e.g. [link](path/to/file.md)) was silently skipped and no callout list was generated. The test for this had been passing spuriously because ShouldContainHtml had a separate bug comparing actual HTML to itself (fixed in #3346) — once that was fixed, the real failure became visible.

What

  • Remove / from the [^""#] exclusion in MathInlineAnnotation so callout text can contain forward slashes (needed for Markdown link syntax like [text](path/file.md))
  • Fix EnhancedCodeBlockHtmlRenderer to emit <li> and its inline content without an intermediate newline (Write instead of WriteLine), matching the HTML structure the test asserts

The MathInlineAnnotation regex excluded `/` from callout text, breaking
link syntax like `[link](path/to/file.md)`. Also fix the inline annotation
renderer to emit `<li>` and content without an intermediate newline so
the HTML structure matches what tests assert.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@Mpdreamz Mpdreamz requested a review from a team as a code owner May 19, 2026 14:43
@Mpdreamz Mpdreamz requested a review from reakaleek May 19, 2026 14:43
@Mpdreamz Mpdreamz added the bug label May 19, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 553700a7-b1ee-4a39-af08-55f287deb57f

📥 Commits

Reviewing files that changed from the base of the PR and between f6de2c5 and fc58dcd.

📒 Files selected for processing (2)
  • src/Elastic.Markdown/Myst/CodeBlocks/CallOutParser.cs
  • src/Elastic.Markdown/Myst/CodeBlocks/EnhancedCodeBlockHtmlRenderer.cs

📝 Walkthrough

Walkthrough

This pull request enables inline code callout annotations to use slash-containing identifiers. The regex pattern in CallOutParser is relaxed to permit forward slashes after the // or # marker, allowing identifiers like //path/to/feature. The corresponding HTML renderer adjusts whitespace handling to emit cleaner inline callout markup by writing opening tags and content on the same line before the closing tag.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: fixing the inline callout regex to allow forward slashes and correcting the li rendering for markdown links.
Description check ✅ Passed The description clearly explains the root cause (regex excluding /), the impact (markdown links being skipped), and the fixes applied to both the regex and HTML renderer.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/inline-callout-regex-and-rendering

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Mpdreamz Mpdreamz merged commit 908493a into main May 19, 2026
25 checks passed
@Mpdreamz Mpdreamz deleted the fix/inline-callout-regex-and-rendering branch May 19, 2026 19:31
groman92 pushed a commit that referenced this pull request May 20, 2026
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants