max-mapper / yo-yo

A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML entities

daryl opened this issue · comments

For some reason I can't use HTML entities.

export default props => {
  return yo`
    <footer class="Footer">
      &copy;
    </footer>
  `;
};

This just renders &copy; instead than the © symbol.

Any ideas?

Everything is escaped by default. You can just use © directly or unicode \u00A9. Otherwise you can use innerHTML on the element to insert unescaped HTML.

It escapes everything by default for security but there might be a better way to handle HTML entities without sacrificing security.