Skip to content

HTML entities do not work #4

@jmas

Description

@jmas

Hello. Have an issue with HTML Entities started with & and finished with ;.

Example:

export function createTask (task, index) {
  return html`
    <li>
      <label>
        <input type="checkbox" onclick="${onTaskChange}" value=${index} ${task.done ? 'checked': ''} />
        ${task.name}
        <button onclick="${onTaskRemove}" data-index=${index}>&times;</button>
      </label>
    </li>
  `;
}

Here inside <button> tag we see HTML Entity &times; that escaped and do not insert in DOM as correct symbol ×.

Another problem if we instead &times; insert UTF-8 char ×. It do not parsed correctly and insert to DOM broken UTF-8 symbol Г—.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions