A
A
AlexSND2018-04-03 16:21:26
Pug
AlexSND, 2018-04-03 16:21:26

Why does the PUG mixin make "xlink:href" just "href"?

Can't solve the problem:
there is a pug mixin for inserting an svg icon:

mixin icon(name, w, h, cl)
  - cl = cl || ''
    svg(width=w height=h class=cl)
      use(xlink:href="img/sprite-svg.svg#" + name)

when compiling , xlink is stubbornly removed , leaving just href
Maybe someone came across? thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
ElijahTr, 2018-04-04
@ElijahTr

Apparently because the namespace for the html, svg and math elements is known to the browser even without specifying them.
https://codepen.io/elijah_tr/pen/vRaWdd
+ https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question