temple icon indicating copy to clipboard operation
temple copied to clipboard

Aliasing doesn't work for SVG elements

Open teatwig opened this issue 5 months ago • 0 comments

Describe the bug

Tag names for SVG elements can't be aliased. I saw in the code that aliasing is currently only implemented for HTML elements, but it should probably work for SVG and MathML too.

To Reproduce

I have the following code:

text = "foobar"
temple do
  text
end

This will currently output <text></text> because text is the name of an SVG element. Since temple prioritizes its own function names this is expected behavior.

I then add the following configuration:

config :temple,
  aliases: [
    text: :text_tag
  ]

Expected behavior

The code will output foobar.

teatwig avatar Nov 05 '25 22:11 teatwig