max-mapper/yo-yo

HTML entities

daryl opened this issue · 1 comments

daryl commented

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?

shama commented

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.