aboutsummaryrefslogtreecommitdiffstats
path: root/src/bootstrap/google-prettify/prettify.js
diff options
context:
space:
mode:
authorMisko Hevery2012-05-07 15:19:26 -0700
committerMisko Hevery2012-05-07 15:43:09 -0700
commitaa02534865c8e43dcef9e218b12c8c717c837205 (patch)
tree52cf4293c9add6740abe4f0cc2c7b040b2b473f1 /src/bootstrap/google-prettify/prettify.js
parentb99f65f64d1e54315b3210d78a9a9adbcf34c96c (diff)
downloadangular.js-aa02534865c8e43dcef9e218b12c8c717c837205.tar.bz2
bug(ie8 docs): docs now work on ie8
Diffstat (limited to 'src/bootstrap/google-prettify/prettify.js')
-rw-r--r--src/bootstrap/google-prettify/prettify.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bootstrap/google-prettify/prettify.js b/src/bootstrap/google-prettify/prettify.js
index c70e9524..b18fc223 100644
--- a/src/bootstrap/google-prettify/prettify.js
+++ b/src/bootstrap/google-prettify/prettify.js
@@ -1350,11 +1350,13 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[
* or the 1-indexed number of the first line in sourceCodeHtml.
*/
function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
- var container = document.createElement('pre');
+ // PATCHED: http://code.google.com/p/google-code-prettify/issues/detail?id=213
+ var container = document.createElement('div');
// This could cause images to load and onload listeners to fire.
// E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
// We assume that the inner HTML is from a trusted source.
- container.innerHTML = sourceCodeHtml;
+ container.innerHTML = '<pre>' + sourceCodeHtml + '</pre>';
+ container = container.firstChild;
if (opt_numberLines) {
numberLines(container, opt_numberLines, true);
}