panoply/esthetic

Improve handling of SVG nodes

panoply opened this issue · 0 comments

Description

SVG elements like use and currently setup to be interpreted as voids which makes Prettify complain there is missing start/end items. This rule can actually be adjusted via the grammar option but I have not yet documented this.

Input

The following structure is not accepted and Prettify will complain, this is because the <use> tag is configured as a void:

<svg class="icon">
  <use xlink:href="#svg-icon"></use>
</svg>

Current Workaround

While the above structure will fail, passing a void will ensure everything works:

<svg class="icon">
  <use xlink:href="#svg-icon" /> <!-- make the tag void -->
</svg>