[Repo Assist] Fix HtmlElement SVG serialisation: LinearGradient/RadialGradient emitted invalid tag (radient)#1108
Open
github-actions[bot] wants to merge 7 commits intomainfrom
Conversation
…emitted wrong tag name 'radient' Both LinearGradient and RadialGradient cases in HtmlElement.ToString() were passing the literal string "radient" to the format helper instead of "linearGradient" and "radialGradient" respectively. This meant that any SVG element using these types would render as the invalid tag <radient> in generated HTML. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
approved these changes
Mar 25, 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
Fix a typo in
HtmlElement.ToString()that causedLinearGradientandRadialGradientto emit the invalid SVG tag(radient)instead of the correct(linearGradient)and(radialGradient).Root Cause
In
HtmlModel.fs, thehelpermatch expression delegates to aformathelper by passing the tag name as a string literal. BothLinearGradientandRadialGradientcases were passing"radient"instead of"linearGradient"and"radialGradient"respectively:This is a pure typo — both branches accidentally shared the string
"radient"instead of the full SVG tag names.Impact
Any code that builds an
HtmlElement.LinearGradientorHtmlElement.RadialGradienttree and serialises it to a string (viaToString()or the Razor template pipeline) would produce(radient)elements, which are invalid SVG and would be silently ignored by browsers.Changes
src/FSharp.Formatting.Common/HtmlModel.fsLinearGradientandRadialGradientRELEASE_NOTES.md[Unreleased]changelog entryTest Status
dotnet build FSharp.Formatting.sln --configuration Release— succeeded (1 pre-existing FS0760 warning, unchanged)dotnet test tests/FSharp.Markdown.Tests— 281/281 passeddotnet fantomas src/FSharp.Formatting.Common/HtmlModel.fs --check— no formatting issues