Skip to content

[Repo Assist] Fix Markdown.ToMd multi-paragraph blockquote roundtrip; make code tooltips interactive#1106

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-quotedblock-tooltip-2026-03-23-5db2e36142c59982
Draft

[Repo Assist] Fix Markdown.ToMd multi-paragraph blockquote roundtrip; make code tooltips interactive#1106
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-quotedblock-tooltip-2026-03-23-5db2e36142c59982

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Two targeted fixes addressing one code bug (Task 3) and one UX improvement (Task 10).


1. Fix Markdown.ToMd multi-paragraph blockquote roundtrip (Task 3 — bug fix)

Root cause

formatParagraph serialised QuotedBlock by prefixing every output line with "> " and then emitting a plain blank line ("") after each inner paragraph. A plain blank line closes a CommonMark blockquote, so re-parsing the serialised output would produce multiple separate QuotedBlock nodes instead of the original single one with multiple paragraphs. The old code also emitted "> " lines (with trailing whitespace) because it included the trailing blank that formatParagraph normally appends.

Fix (src/FSharp.Formatting.Markdown/MarkdownUtils.fs)

  • Drop the trailing empty line from each inner paragraph's formatted lines before prefixing with "> ".
  • Emit ">" (an empty blockquote continuation line) between paragraphs instead of a plain blank line.

Tests added (tests/FSharp.Markdown.Tests/Markdown.fs)

  • ToMd preserves a multi-paragraph blockquote as a single blockquote — parses a two-paragraph blockquote, serialises with ToMd, re-parses, and asserts there is exactly one QuotedBlock.
  • ToMd blockquote does not produce trailing-whitespace lines — asserts no "> " lines with trailing whitespace are emitted.

2. Make generated-docs tooltips interactive (Task 10 — forward progress, issue #949)

Problem (#949)

Hovering a code token showed a tooltip, but moving the mouse into the tooltip caused it to immediately hide. Users could not select or copy text from the tooltip.

Root cause

The mouseout handler for trigger elements only checked target.contains(evt.relatedTarget) — but the tooltip div is not a descendant of the trigger, so moving the mouse to the tooltip fired hideTip.

Fix (docs/content/fsdocs-tips.js)

  • In the existing mouseout handler on triggers: if relatedTarget is the tooltip element or one of its descendants, return early (tooltip stays visible).
  • Add a second mouseout handler on div.fsdocs-tip elements: hide the tooltip when the mouse leaves it, unless the mouse has moved back to the originating trigger.

No CSS changes are needed; the tooltip already supports interaction via the Popover API.


Changes

File Change
src/FSharp.Formatting.Markdown/MarkdownUtils.fs Fix QuotedBlock serialisation (paragraph separator + trailing whitespace)
tests/FSharp.Markdown.Tests/Markdown.fs Two new ToMd round-trip tests for blockquotes
docs/content/fsdocs-tips.js Allow mouse to enter tooltip; hide tooltip on tooltip mouseleave
RELEASE_NOTES.md Changelog entries under [Unreleased]

Test Status

  • dotnet build FSharp.Formatting.sln --configuration Release — succeeded (1 pre-existing FS0760 warning, unchanged)
  • dotnet test tests/FSharp.Markdown.Tests283/283 passed (includes 2 new tests)
  • dotnet fantomas … --check — formatting verified via Fantomas
  • dotnet test FSharp.Formatting.sln --configuration Release --no-build — full suite passes (ApiDocs: 88 passed, 4 skipped; all other projects pass)

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@d1d884596e62351dd652ae78465885dd32f0dd7d

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@d1d884596e62351dd652ae78465885dd32f0dd7d

…ips interactive

Task 3 (fix): Markdown.ToMd - QuotedBlock with multiple paragraphs
- A plain blank line between paragraphs in a QuotedBlock closed the blockquote,
  so re-parsing the output produced separate QuotedBlock nodes instead of one.
- Fix: emit an empty blockquote line ('>') as the paragraph separator so the
  blockquote stays open across paragraph boundaries.
- Also eliminates '> ' lines (with trailing whitespace) that the old code produced
  by stripping the trailing empty line that formatParagraph appends before prefixing.
- Added two new tests: roundtrip preserves a single QuotedBlock for multi-paragraph
  blockquotes; no '> ' trailing-whitespace lines are emitted.

Task 10 (forward): Make fsdocs-tips.js tooltips interactive (#949)
- When the mouse moves from a code token into the tooltip, the tooltip is now kept
  visible so users can hover over, select, and copy text.
- A new 'mouseout' handler on the tooltip div hides it when the mouse leaves unless
  it returns to the originating trigger.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants