Skip to content

[Repo Assist] Fix HtmlElement SVG serialisation: LinearGradient/RadialGradient emitted invalid tag (radient)#1108

Open
github-actions[bot] wants to merge 7 commits intomainfrom
repo-assist/fix-htmlmodel-svg-tagnames-4a98562ff07f4a79
Open

[Repo Assist] Fix HtmlElement SVG serialisation: LinearGradient/RadialGradient emitted invalid tag (radient)#1108
github-actions[bot] wants to merge 7 commits intomainfrom
repo-assist/fix-htmlmodel-svg-tagnames-4a98562ff07f4a79

Conversation

@github-actions
Copy link
Contributor

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

Summary

Fix a typo in HtmlElement.ToString() that caused LinearGradient and RadialGradient to emit the invalid SVG tag (radient) instead of the correct (linearGradient) and (radialGradient).

Root Cause

In HtmlModel.fs, the helper match expression delegates to a format helper by passing the tag name as a string literal. Both LinearGradient and RadialGradient cases were passing "radient" instead of "linearGradient" and "radialGradient" respectively:

// Before (wrong):
| LinearGradient(props, children) -> format "radient" props children level
| RadialGradient(props, children) -> format "radient" props children level

// After (correct):
| LinearGradient(props, children) -> format "linearGradient" props children level
| RadialGradient(props, children) -> format "radialGradient" props children level

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.LinearGradient or HtmlElement.RadialGradient tree and serialises it to a string (via ToString() or the Razor template pipeline) would produce (radient) elements, which are invalid SVG and would be silently ignored by browsers.

Changes

File Change
src/FSharp.Formatting.Common/HtmlModel.fs Fix tag name strings for LinearGradient and RadialGradient
RELEASE_NOTES.md Add [Unreleased] changelog entry

Test Status

  • dotnet build FSharp.Formatting.sln --configuration Release — succeeded (1 pre-existing FS0760 warning, unchanged)
  • dotnet test tests/FSharp.Markdown.Tests — 281/281 passed
  • dotnet fantomas src/FSharp.Formatting.Common/HtmlModel.fs --check — no formatting issues

Generated by Repo Assist

Generated by Repo Assist ·

To install this agentic workflow, run

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

…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 dsyme marked this pull request as ready for review March 25, 2026 15:57
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.

1 participant