[Repo Assist] fix: handle EmbedParagraphs in Markdown.ToMd serialiser#1145
Open
github-actions[bot] wants to merge 2 commits intomainfrom
Open
[Repo Assist] fix: handle EmbedParagraphs in Markdown.ToMd serialiser#1145github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
Previously EmbedParagraphs fell through to the catch-all '| _' branch in MarkdownUtils.formatParagraph, emitting a debug printfn to stdout and yielding an empty string. All other formatters (HTML, LaTeX) delegate to cmd.Render() and recurse; this commit brings the Markdown-to-Markdown back-end into line with them. The now-dead catch-all branch is removed so the exhaustiveness checker will catch any new MarkdownParagraph cases that are added without a corresponding formatParagraph clause. Fixes: the debug 'can't yet format' output that appeared on stdout whenever a document containing EmbedParagraphs was serialised via Markdown.ToMd. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
14 tasks
dsyme
approved these changes
Apr 6, 2026
nojaf
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Markdown.ToMd(the Markdown-to-Markdown serialiser inMarkdownUtils.formatParagraph) did not handle theEmbedParagraphsAST node. It fell through to a catch-all| _branch that:// can't yet format <EmbedParagraphs …> to markdownBoth the HTML formatter (
HtmlFormatting.fsline 169) and the LaTeX formatter (LatexFormatting.fsline 124) already handleEmbedParagraphsby callingcmd.Render()and recursing. This PR bringsMarkdownUtils.formatParagraphinto consistency with them.Root cause
The
| EmbedParagraphs(cmd, _)case was simply missing fromformatParagraphinMarkdownUtils.fs.Fix
Add:
All tests pass; new test
ToMd serialises EmbedParagraphs by delegating to Render()confirms the fix.