/* Run when the page has loaded*/ $(document).ready(function(event) { /* This formats all the inline code examples. */ $('p:contains("c-line"), li:contains("c-line")').each(function(index, el) { $(el).html(el.innerText.replace( /{\%\s*c-line\s*\%}(.*?){\%\s*c-line-end\s*\%}/gi, '$1' )) }) /* This formats all the code block examples. */ $('p:contains("c-block"), li:contains("c-block")').each(function(index, el) { $(el).html(el.innerHTML.replace( /{\%\s*c-block\s*language=[\"|\'](.+)[\"|\']\s*\%}(.*?)\{\%\s*c-block-end\s*\%}/gi, "
$2
" )) }) /* Run Highlight JS on every code block */ $('pre code').each(function(index, codeBlock) { /* Remove first child
*/ codeBlock.removeChild(codeBlock.childNodes[0]) hljs.highlightBlock(codeBlock) }) });