mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 14:50:39 -04:00
Nothing against the venerable old library, but it’s only being used here as a loader for the syntax highlighter. This approach will work in everything even remotely modern (IE9+, everything else), and saves 30Kb gzipped plus parsing time on the pages it’s used on.
10 lines
265 B
JavaScript
10 lines
265 B
JavaScript
'use strict';
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
if(hljs){
|
|
var blocks = document.querySelectorAll('code.html.full, code.css.full, figure code.html');
|
|
for (var i=0; i<blocks.length; i++) {
|
|
hljs.highlightBlock(blocks[i]);
|
|
};
|
|
}
|
|
});
|