[Repo Assist] Fix Markdown.ToMd multi-paragraph blockquote roundtrip; make code tooltips interactive#1106
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
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>
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
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)