Mercurial > public > mercurial-scm > hg
diff tests/test-hgweb-commands.t @ 35415:56854848e485
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
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 15 Dec 2017 12:15:58 +0800 |
parents | f84b01257e06 |
children | 1721ce06100a |
line wrap: on
line diff
--- a/tests/test-hgweb-commands.t Thu Dec 14 16:01:28 2017 -0500 +++ b/tests/test-hgweb-commands.t Fri Dec 15 12:15:58 2017 +0800 @@ -1814,8 +1814,6 @@ </div> <script> - <!-- hide script content - var data = [{"edges": [[0, 0, 1, 3, "FF0000"]], "node": "cad8025a2e87", "vertex": [0, 1]}, {"edges": [[0, 0, 1, 3, ""]], "node": "1d22e65f027e", "vertex": [0, 1]}, {"edges": [[0, 0, 1, 3, ""]], "node": "a4f92ed23982", "vertex": [0, 1]}, {"edges": [], "node": "2ef0ac749a14", "vertex": [0, 1]}]; var graph = new Graph(); graph.scale(39); @@ -1826,8 +1824,6 @@ } graph.render(data); - - // stop hiding script --> </script> <div class="extra_nav">