diff options
author | Andrew Dolgov <[email protected]> | 2020-05-17 18:47:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-05-17 18:47:21 +0300 |
commit | 1077abdddae0e9068820c5630525b94c0e173831 (patch) | |
tree | b70d9bb9670daff6a03500c8d3dd8fb1c67b5701 /init.js |
initial
Diffstat (limited to 'init.js')
-rw-r--r-- | init.js | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +require(['dojo/_base/kernel', 'dojo/ready', 'dojo/request/script'], function (dojo, ready, script) { + ready(function() { + script.get("plugins.local/highlightjs/highlight.pack.js", + {checkString: 'hljs'}).then(() => { + + console.log('hljs loaded', hljs) + + PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) { + row.querySelectorAll("code").forEach((elem) => { + console.log('about to highlight', elem); + + hljs.highlightBlock(elem); + }); + }); + + PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function(row) { + row.querySelectorAll("code").forEach((elem) => { + console.log('about to highlight', elem); + + hljs.highlightBlock(elem); + }); + }); + }); + }); +}); |