HomePhabricator

hgweb: stop using HTML comments in <script>

Authored by av6.

Description

hgweb: stop using HTML comments in <script>

Once upon a time, in 1995, there were browsers that didn't understand <script>
tags and they would simply show the code inside as text. This started a
tradition of wrapping everything inside <script> in <!-- HTML comments -->.
Nowadays, it's not only not needed, but can be considered harmful[1]:

  • within XHTML documents, the source will actually be hidden from all browsers and rendered useless
  • -- is not allowed within HTML comments, so any decrement operations in script are invalid

[1]: http://www.javascripttoolbox.com/bestpractices/#comments

Details

Committed
av6Dec 14 2017, 11:15 PM
Parents
rHGa51541681b8d: merge with stable
Branches
Unknown
Tags
Unknown