Skip to content

Cannot use <use> (in <svg>) any more #1771

@jbg

Description

@jbg

As of #1738 being merged, I can't use <use> inside <svg> in html! {} any more. (Maybe other SVG elements are affected too; I haven't tried.) For example, the following:

html!{
  <a class="btn btn-primary" href="https://example.org/">
    <svg class="bi" fill="currentColor">
      <use href="/bootstrap-icons.svg#wrench"/>
    </svg>
    <span>{"Go to example.org"}</span>
  </a>
}

fails with this error:

error: expected a valid html element
   --> src/pages/example.rs:140:19
    |
140 |                   <use href="/bootstrap-icons.svg#wrench"/>
    |                   ^

Originally posted by @jbg in #1738 (comment)

Metadata

Metadata

Assignees

Labels

bugmacroIssues relating to our procedural or declarative macros

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions