diff --git a/demos/blockfactory/factory_utils.js b/demos/blockfactory/factory_utils.js index 3e63006c7..b02bfa034 100644 --- a/demos/blockfactory/factory_utils.js +++ b/demos/blockfactory/factory_utils.js @@ -902,9 +902,9 @@ FactoryUtils.defineAndGetBlockTypes = function(blockDefsString, format) { FactoryUtils.injectCode = function(code, id) { var pre = document.getElementById(id); pre.textContent = code; - code = pre.textContent; - code = PR.prettyPrintOne(code, 'js'); - pre.innerHTML = code; + // Remove the 'prettyprinted' class, so that Prettify will recalculate. + pre.className = pre.className.replace('prettyprinted', ''); + PR.prettyPrint(); }; /** diff --git a/demos/blockfactory/index.html b/demos/blockfactory/index.html index 868d20542..0c1fc87b9 100644 --- a/demos/blockfactory/index.html +++ b/demos/blockfactory/index.html @@ -124,11 +124,11 @@
Block Definitions:
- +Generator Stubs:
- +