weavejester / hiccup

Fast library for rendering HTML in Clojure
http://weavejester.github.io/hiccup
Eclipse Public License 1.0
2.68k stars 174 forks source link

Escape single quote with something else than ' ? #146

Closed Jarzka closed 6 years ago

Jarzka commented 7 years ago

When a single quote character (') is escaped with escape-html function, the end result is '. This is not an official entity in HTML. We noticed, for example, that when HTML mail is sent with escaping, it does render correctly in Outlook (Outlook renders single quote characters as text ' instead of ';

According to this discussion, ' should be prefered.

weavejester commented 7 years ago

It already does, as long as the *html-mode* is set to the legacy :sgml format.

There are three values *html-mode* can be: :xhtml, for HTML in XML format, :html for HTML5 and generally anything supported by a browser, and :sgml for HTML4 and earlier.

' is an official entity in HTML5, just not in HTML4 or earlier.