[Repo Assist] Fix Markdown.ToMd multi-paragraph blockquote roundtrip; make code tooltips interactive#1106
Conversation
…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>
|
@nojaf does this look ok? |
|
✅ Repo Assist completed successfully! |
…y adjacent When the tooltip is repositioned to stay within the viewport (e.g. flipped above the cursor or shifted left), there can be a gap between the trigger element and the tooltip. Previously the mouseout handler on the trigger checked relatedTarget immediately; any gap caused the tooltip to hide before the mouse could travel across it. Replace the synchronous hideTip calls in both mouseout handlers with a 300 ms scheduleHide. The pending hide is cancelled whenever the mouse enters the tooltip (mouseover on div.fsdocs-tip) or re-enters the trigger (start of showTip / cancelHide). This is the standard hover-intent pattern and works regardless of tooltip position. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Commit pushed:
|
|
🤖 This is an automated response from Repo Assist. Good catch, Root cause: when the tooltip is repositioned to stay within the viewport (flipped above the cursor or shifted left), there's a gap between the trigger and tooltip. The Fix: replaced the synchronous The
|
…23-5db2e36142c59982
…23-5db2e36142c59982
…23-5db2e36142c59982
…23-5db2e36142c59982

🤖 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.ToMdmulti-paragraph blockquote roundtrip (Task 3 — bug fix)Root cause
formatParagraphserialisedQuotedBlockby 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 separateQuotedBlocknodes instead of the original single one with multiple paragraphs. The old code also emitted"> "lines (with trailing whitespace) because it included the trailing blank thatformatParagraphnormally appends.Fix (
src/FSharp.Formatting.Markdown/MarkdownUtils.fs)"> ".">"(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 withToMd, re-parses, and asserts there is exactly oneQuotedBlock.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
mouseouthandler for trigger elements only checkedtarget.contains(evt.relatedTarget)— but the tooltip div is not a descendant of the trigger, so moving the mouse to the tooltip firedhideTip.Fix (
docs/content/fsdocs-tips.js)mouseouthandler on triggers: ifrelatedTargetis the tooltip element or one of its descendants, return early (tooltip stays visible).mouseouthandler ondiv.fsdocs-tipelements: 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
src/FSharp.Formatting.Markdown/MarkdownUtils.fsQuotedBlockserialisation (paragraph separator + trailing whitespace)tests/FSharp.Markdown.Tests/Markdown.fsToMdround-trip tests for blockquotesdocs/content/fsdocs-tips.jsRELEASE_NOTES.md[Unreleased]Test Status
dotnet build FSharp.Formatting.sln --configuration Release— succeeded (1 pre-existing FS0760 warning, unchanged)dotnet test tests/FSharp.Markdown.Tests— 283/283 passed (includes 2 new tests)dotnet fantomas … --check— formatting verified via Fantomasdotnet test FSharp.Formatting.sln --configuration Release --no-build— full suite passes (ApiDocs: 88 passed, 4 skipped; all other projects pass)