Repository navigation
Conversation
Signed-off-by: Бат-Орших <34618353+orshih6@users.noreply.github.com>
This branch has not been deployed
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.
The Attributes tab is offered for every node, but
base.svgnever declared anhtmlAttributesprop. Itsrender()and canvas editor ignored the bag, so anaria-labelordata-*added to an SVG was saved but never reached the page.Changes:
base.svgnow declareshtmlAttributesin its TypeBox props schema and property schema, like the other base modules.render()adds the attributes to the opening<svg>tag using the sharedhtmlAttributesAttr. It goes through the samenormalizeHtmlAttributessanitisation gate, so event handlers,class/style, reserved runtime names and dangerous URL schemes are still dropped. The title-derivedrole/aria-labelcomes first, then the authored attributes, then the markup's own root attributes. Earlier attributes win in HTML, so the accessible-label setting overrides a customaria-label, and custom attributes override same-named attributes already in the pasted markup.SvgEditorspreads the same normalised attributes onto the canvas root, in the same precedence, so the editor matches the published output. An authoredhiddengoes through the existinguseCanvasHiddenAttributepath.Inputs and checkboxes already publish
htmlAttributeson the current main branch, so they need no change here. The new integration tests cover them anyway, so a regression would show up.Testing:
base.button,base.input,base.checkboxandbase.svgthroughrenderNodewith the real registry. They assert thataria-labeland adata-*attribute appear on the element's own tag. A separate SVG case checks sanitisation, escaping and ordering next to the title label.onclick.bun teston the touched test files and the SVG import tests,eslinton the changed files andtsc --noEmit -p tsconfig.app.jsonall pass.🤖 Generated with Claude Code
Fixes #834
This change was prepared with an AI coding agent (Claude) and opened automatically after an automated review, so no person has read it yet. I'm happy to make any changes you'd like.