[Repo Assist] test: add OutputBlock, AnchorLink, and code-block language specifier tests#1194
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
Add four unit tests that cover previously-untested paths in Markdown.ToMd and Markdown.ToHtml: - ToMd preserves fenced code block language specifier (```fsharp) - ToMd serialises OutputBlock non-HTML as a fenced code block - ToMd serialises OutputBlock HTML as raw inline HTML (no fence) - ToHtml renders AnchorLink as a named anchor element All 350 FSharp.Markdown.Tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Apr 29, 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 is an automated pull request from Repo Assist.
Summary
Adds four unit tests that cover previously-untested code paths in
Markdown.ToMdandMarkdown.ToHtml.Motivation
The test file had several gaps:
The existing
ToMd preserves a fenced code blocktest verified only that the code body was preserved — it did not check that the language specifier (\``fsharp`) was kept in the output.OutputBlock(notebook execution output) was never exercised through unit tests. Two variants exist:text/html(emitted as raw HTML) and everything else (wrapped in a fenced code block). Without tests, either path could silently regress.AnchorLinkis used byApiDocsto emit in-page named anchors ((a name="...") (/a)). It had zero unit test coverage inMarkdown.ToHtml.Changes
tests/FSharp.Markdown.Tests/Markdown.fs— four new[(Test)]entries:ToMd preserves fenced code block language specifierToMd serialises OutputBlock non-HTML as fenced code blockOutputBlock("...", "text/plain", ...)→\``...````ToMd serialises OutputBlock HTML as raw HTMLOutputBlock("...", "text/html", ...)→ raw HTML, no fenceToHtml renders AnchorLink as named anchorAnchorLink("id", ...)→(a name="id")...(/a)Test Status
Build: 0 errors
Tests: 350 / 350 FSharp.Markdown.Tests pass ✅ (4 new tests added)
Generated by 🌈 Repo Assist, see workflow run.