mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-04-25 08:50:11 +00:00
[highlightjs] Use new 'head'/'footer' hooks
- Create separate addon javascript file - Register stylesheet and Javascript files
This commit is contained in:
parent
0afab99d84
commit
27a48ae84a
2 changed files with 18 additions and 24 deletions
6
highlightjs/highlightjs.js
Normal file
6
highlightjs/highlightjs.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
hljs.initHighlightingOnLoad();
|
||||
|
||||
document.addEventListener('postprocess_liveupdate', function () {
|
||||
var blocks = document.querySelectorAll('pre code:not(.hljs)');
|
||||
Array.prototype.forEach.call(blocks, hljs.highlightBlock);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue