LeaVerou / dabblet

An interactive CSS playground
http://dabblet.com
817 stars 148 forks source link

Can't paste html entities #233

Open oblitum opened 10 years ago

oblitum commented 10 years ago

The editor converts html entities to the corresponding reserved characters, so when I paste:

<span class="scIncluded">&lt;hello&gt;</span>

What I get in the editor is the < and > characters, which makes the html output broken:

<span class="scIncluded"><hello></span>
oblitum commented 10 years ago

This can be fixed by:

text = text.replace(/&/g, "&amp;");

before inserting html from clipboard.