Commit 2d4eee98 authored by Nick Ham's avatar Nick Ham

removed process_pre_tags.js

parent 17ccd866
Pipeline #86052455 passed with stage
in 1 minute and 3 seconds
12:04:10 Tuesday September 10 2019
00:03:41 Thursday October 03 2019
index
index
template/page.template
'template/page.template'
content/index.content
template/footer.content
template/head.content
template/menu.content
template/page.template
'content/index.content'
'template/footer.content'
'template/head.content'
'template/menu.content'
'template/page.template'
/*
Has browser ignore leading tabs for <pre> code blocks.
modified from: http://stackoverflow.com/a/8505182/4525897
*/
var pre_elements = document.getElementsByTagName('pre');
for (var i = 0; i < pre_elements.length; i++)
{
var content = pre_elements[i].innerHTML;
var tabs_to_remove = '';
while(content.indexOf('\t') == '0' || content.substring(0, 4) == " ")
{
if(content.indexOf('\t') == '0')
{
tabs_to_remove += '\t';
content = content.substring(1);
}
else
{
tabs_to_remove += " ";
content = content.substring(4);
}
}
var re = new RegExp('\n' + tabs_to_remove, 'g');
content = content.replace(re, '\n');
if(content.lastIndexOf("\n")>0)
content = content.substring(0, content.lastIndexOf("\n"));
pre_elements[i].outerHTML = '<pre class="' + pre_elements[i].className + '">' + content + '</pre>';
}
......@@ -159,7 +159,6 @@
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/process_pre_tags.js"></script>
<script src='assets/js/process_md_blocks.js'></script>
<script src="assets/js/showdown.min.js"></script>
<script>
......
......@@ -24,7 +24,6 @@
<script src="@pathtofile(site/assets/js/breakpoints.min.js)"></script>
<script src="@pathtofile(site/assets/js/util.js)"></script>
<script src="@pathtofile(site/assets/js/main.js)"></script>
<script src="@pathtofile(site/assets/js/process_pre_tags.js)"></script>
<script src='@pathtofile(site/assets/js/process_md_blocks.js)'></script>
<script src="@pathtofile(site/assets/js/showdown.min.js)"></script>
<script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment