1
0
forked from GitHub/gf-core

RGL browser: escape html when printing code (by using .text() instead of .html())

This commit is contained in:
john.j.camilleri
2013-05-24 09:41:01 +00:00
parent 87eb018d3a
commit 03f5f02577
2 changed files with 10 additions and 10 deletions

View File

@@ -81,7 +81,7 @@
<dt><code>romance</code></dt><dd>Used by Catalan, French, Italian, Romanian, Spanish</dd> <dt><code>romance</code></dt><dd>Used by Catalan, French, Italian, Romanian, Spanish</dd>
<dt><code>scandinavian</code></dt><dd>Used by Danish, Norwegian, Swedish</dd> <dt><code>scandinavian</code></dt><dd>Used by Danish, Norwegian, Swedish</dd>
</dl> </dl>
<h3>Issues</h3> <h3>Issues</h3>
<h4>Something is missing or out of date</h4> <h4>Something is missing or out of date</h4>
@@ -98,7 +98,7 @@
<br style="clear:both" /> <br style="clear:both" />
</div> </div>
<footer id="footer"> <footer id="footer">
John J. Camilleri<br/><em>Updated 2013-04-03</em> John J. Camilleri<br/><em>Updated 2013-05-24</em>
</footer> </footer>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="jquery.history.min.js"></script> <script src="jquery.history.min.js"></script>

View File

@@ -98,7 +98,7 @@ $(document).ready(function() {
} }
} }
var setCode = function(code) { var setCode = function(code) {
$('#code pre').html(code); $('#code pre').text(code);
prettyPrint(); prettyPrint();
} }
var updateScopeCount = function(){ var updateScopeCount = function(){
@@ -350,7 +350,7 @@ $(document).ready(function() {
var code = (e.keyCode ? e.keyCode : e.which); var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { // Enter if(code == 13) { // Enter
runFilter(); runFilter();
} }
}); });
$("#clear").click(function(){ $("#clear").click(function(){
$("#search") $("#search")
@@ -376,21 +376,21 @@ $(document).ready(function() {
function delayed () { function delayed () {
if (!execAsap) if (!execAsap)
func.apply(obj, args); func.apply(obj, args);
timeout = null; timeout = null;
}; };
if (timeout) if (timeout)
clearTimeout(timeout); clearTimeout(timeout);
else if (execAsap) else if (execAsap)
func.apply(obj, args); func.apply(obj, args);
timeout = setTimeout(delayed, threshold || 100); timeout = setTimeout(delayed, threshold || 100);
}; };
} }
// smartresize // smartresize
jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
})(jQuery,'smartresize'); })(jQuery,'smartresize');
// usage: // usage:
$(window).smartresize(function() { $(window).smartresize(function() {
recalculateHeights(); recalculateHeights();