Skip to content

Render Markdig CustomContainer admonition blocks#132

Merged
boxofyellow merged 4 commits into
mainfrom
copilot/add-console-custom-container-renderer
May 15, 2026
Merged

Render Markdig CustomContainer admonition blocks#132
boxofyellow merged 4 commits into
mainfrom
copilot/add-console-custom-container-renderer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

New Feature

Markdig parses fenced ::: blocks (admonitions like :::note, :::warning) into CustomContainer / CustomContainerInline AST nodes, but the renderer had no handler for them so the content was silently dropped.

What does this feature do?

Renders custom containers as a framed block with the Info label (e.g. note) on top, then the children. Inline ::tag:: spans are also rendered.

:::note
This is a *note* admonition with **bold** content.
:::

Implementation details

Followed docs/adding_a_new_renderer.md:

  • Renderers (ObjectRenderers/ConsoleObjectRenderers.cs): added ConsoleCustomContainerRenderer (frame + styled Info label + children) and ConsoleCustomContainerInlineRenderer (styled inline span).
  • Registration (ConsoleRenderer.cs): both registered; the inline renderer is placed before ConsoleEmphasisInlineRenderer since CustomContainerInline : EmphasisInline and Markdig picks the first assignable renderer.
  • DisplayOptions: three new TextStyle properties — CustomContainer (body), CustomContainerInfo (label), CustomContainerInline — defaulting to bold for the labels and unstyled for the body. Clone() updated accordingly.
  • Tests: new customContainer.md / .txt fixture, two RendererTests_CustomContainer* style assertions, and the three styles added to m_crazyOptions.
  • Bracket escaping: extended bracketEscaping.md with [test27][test29] exercising both block and inline containers; .txt regenerated.
  • Example doc: new "Custom Containers (Admonitions)" section in example.md.

Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Copilot AI changed the title [WIP] Add console renderer for custom container blocks Render Markdig CustomContainer admonition blocks May 15, 2026
Copilot AI requested a review from boxofyellow May 15, 2026 01:56
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.71%. Comparing base (55c3cc5) to head (1f167df).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   95.64%   95.71%   +0.07%     
==========================================
  Files          28       29       +1     
  Lines        1606     1635      +29     
  Branches      171      172       +1     
==========================================
+ Hits         1536     1565      +29     
  Misses         46       46              
  Partials       24       24              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Owner

@boxofyellow boxofyellow left a comment

Choose a reason for hiding this comment

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

@copilot Please address this comment.

Additionally, I have added a new step to guide doc https://github.com/boxofyellow/ConsoleMarkdownRenderer/blob/main/docs/adding_a_new_renderer.md for updating the changelog. Please apply those changes within this PR as well.

Comment thread ObjectRenderers/ConsoleObjectRenderers.cs Outdated
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 15, 2026

@copilot Please address this comment.

Additionally, I have added a new step to guide doc https://github.com/boxofyellow/ConsoleMarkdownRenderer/blob/main/docs/adding_a_new_renderer.md for updating th...

Added a changelog entry for this PR under ## Upcoming Changes### :art: Renderers :art: in docs/CHANGELOG.md (with the before/after image placeholders) in 05481b4.

Copilot AI requested a review from boxofyellow May 15, 2026 11:19
Updated image URLs in CHANGELOG with specific dimensions.
@boxofyellow boxofyellow marked this pull request as ready for review May 15, 2026 11:33
@boxofyellow boxofyellow merged commit ba02956 into main May 15, 2026
12 checks passed
@boxofyellow boxofyellow deleted the copilot/add-console-custom-container-renderer branch May 15, 2026 11:34
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.

[Markdig] Consider rendering Custom Container blocks (admonitions)

2 participants