When escaping & and <, must replace all occurrences, not only the first one
authorJan Lahoda <jlahoda@netbeans.org>
Tue, 04 Dec 2012 18:34:42 +0100
changeset 9139328dc780b53
parent 912 4907f3e21a9c
child 914 66cd9c448ebc
When escaping & and <, must replace all occurrences, not only the first one
remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/showCode.html
     1.1 --- a/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/showCode.html	Sun Dec 02 23:04:01 2012 +0100
     1.2 +++ b/remoting/server/web/web.ui/src/org/netbeans/modules/jackpot30/backend/ui/showCode.html	Tue Dec 04 18:34:42 2012 +0100
     1.3 @@ -14,7 +14,7 @@
     1.4              var $spans = [${spans}];
     1.5              var $current = 0;
     1.6              for (var i = 0; i < $highlights.length; i++ ) {
     1.7 -                $codeEl.append($('<a id="p' + $current + '"><span class="' + $highlights[i] + '"' + ($highlights[i].indexOf("identifier") !== (-1) ? ' onclick="ic(' + $current + ')"' : '') + '>' + $code.slice($current, $current+$spans[i]).replace('&', '&amp;').replace('<', '&lt;') + "</span></a>"));
     1.8 +                $codeEl.append($('<a id="p' + $current + '"><span class="' + $highlights[i] + '"' + ($highlights[i].indexOf("identifier") !== (-1) ? ' onclick="ic(' + $current + ')" jpt30pos="' + $current + '"' : '') + '>' + $code.slice($current, $current+$spans[i]).replace(/&/g, '&amp;').replace(/</g, '&lt;') + "</span></a>"));
     1.9                  $current += $spans[i];
    1.10              }
    1.11