Trilium-SyntaxHighlightWidget
Trilium-SyntaxHighlightWidget copied to clipboard
Syntax highlight Trilium widget for editable note codeblocks using highlight.js
This is a great widget/plugin I have been dreaming of for so long, so thank you so much for sharing it. The only problem is that it took me so...
Firstly, thank you very much for making this. It's really useful. When including a note in another, the syntax highlighting is lost.  
How to attach the [highlight.min.js](https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js) file to that note?
This PR implements the support of manually selecting highlight language. To achieve this, `MIME_TYPES_DICT` was borrowed from [mime_types.js#L3](https://github.com/zadam/trilium/blob/dbd312c88db2b000ec0ce18c95bc8a27c0e621a1/src/public/app/services/mime_types.js#L3) and its `title` property was changed according to [SUPPORTED_LANGUAGES.md](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md).
The highlighting is wrongly triggered while IME inputs are not committed, which is a normal situation for CJK inputs. The current version will give a result like this:  This...
I have tried the full script and manually executing the script. Did I do something wrong? `Execution of JS note "SyntaxHighlight" failed with error: Load of script note "SyntaxHighlight" failed...
This almost perfectly solves the problem.. with one exception that may or may not be a problem for others.. Is it possible to (even manually) change the color scheme? the...