Render Markdig Figure and FigureCaption blocks#142
Conversation
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot please checkout these comments.
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot Please rebase (not merge in master) this PR and address conflicts.
I attempted the rebase locally (rebased cleanly onto |
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
979950f to
fed8a46
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #142 +/- ##
==========================================
+ Coverage 95.78% 95.82% +0.03%
==========================================
Files 30 30
Lines 1662 1676 +14
Branches 176 176
==========================================
+ Hits 1592 1606 +14
Misses 46 46
Partials 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Markdig's
UseFigures()extension (enabled viaUseAdvancedExtensions()) parses^^^-delimited figure blocks intoFigure/FigureCaptionAST nodes, but no renderers were registered for them, so figures and their captions were silently dropped.Changes
ObjectRenderers/ConsoleObjectRenderers.cs):ConsoleFigureRenderer— wraps children in aStyle.Plainframe (mirrorsConsoleCustomContainerRenderer/ConsoleQuoteBlockRenderer).ConsoleFigureCaptionRenderer— writes inline content wrapped in the newFigureCaptionstyle.ConsoleRendererahead ofConsoleContainerInlineRenderer.DisplayOptions.FigureCaption: newTextStyledefaulting toItalic; cloned inClone().figure.md/figure.txtpair,RendererTests_FigureCaptionTest(default +useCrazy),m_crazyOptionsextended,bracketEscapingresources extended with[test30]–[test32]covering caption text, bold inside captions, and image alt text inside figures.## Figuressection inexample.md; changelog entry underUpcoming Changes › Renderers.Rendered output for
^^^ caption\n\n^^^: