Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self closing tags stripped out / removed? #56

Closed
oller opened this issue Apr 4, 2016 · 1 comment
Closed

Self closing tags stripped out / removed? #56

oller opened this issue Apr 4, 2016 · 1 comment

Comments

@oller
Copy link

oller commented Apr 4, 2016

I'm using metalsmith to render some SVG markup, which contain a lot of self closing tags:

For example:

 <circle cx="33" cy="19" r="2"/>

When printing these out at the layout level with metalsmith there is no problem, everything is preserved.

However when I'm looping through a collection:

index.html

        {{#each collections.components }}
{{>component}}
        {{/each}}

component.html

    <div class="demo-rendered cf">
        {{{ this.contents }}}
    </div>

output

    <div class="demo-rendered cf">
         <circle cx="33" cy="19" r="2">
    </div>

All the self-closing tags are stripped out, which means the browser assumes these tags need nesting and everything goes downhill pretty quickly.

The fact these are only removed when returning from the collection implies the issue is with this plugin. Is this something anyone else has run into?

(note this also applies to more basic self closing tags: <br/>, <input type="text />

@webketje
Copy link
Member

Pretty sure this has nothing to do with collections, collections does not touch a file's contents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants