HTML escaping #13

Merged
merged 3 commits into from Sep 27, 2012

Conversation

Projects
None yet
2 participants
Contributor

alecperkins commented Sep 25, 2012

Added escaping of HTML-unsafe characters, eg < and >, which were not getting preserved when automatically creating word groups. Also, I fixed ampersand wrapping to wrap all ampersands, not just the first.

Source html: "CRAS &lt;VESTIBULUM&gt; &amp; ELIT &amp; INCEPTOS"

Without escaping & wrapping all ampersands:

![](http://skitch.droptype.com/Screen shot 2012-09-25 at 1.29.10 PM.png)

With:

![](http://skitch.droptype.com/Screen shot 2012-09-25 at 1.29.01 PM.png)

alecperkins added some commits Sep 25, 2012

Wrap all ampersands in span.amp.
`"&"`, instead of `/&/g`, only matches the first ampersand, because JavaScript is weird like that.
HTML-escape the text.
Without this, HTML-unsafe characters, like < and >, don't get preserved.

freqdec added a commit that referenced this pull request Sep 27, 2012

@freqdec freqdec merged commit 464d479 into freqdec:master Sep 27, 2012

Owner

freqdec commented Sep 27, 2012

Thanks again Alec. I'm suprised the htmlentities stuff didn't get logged as a bug well before this! Much appreciated & again, many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment