How to highlight with a custom language and extension mapping
quentin opened this issue · 1 comments
Hi,
I have a custom language (say foolang
) registered in the hljs
instance, is it possible to highlight a language that is not listed there:
diff2html/src/ui/js/highlight.js-helpers.ts
Line 164 in e5c8139
It is properly detected in the language
variable (because the extension of the filename in the diff is .foolang
):
diff2html/src/ui/js/diff2html-ui-base.ts
Lines 144 to 145 in e5c8139
But this code discards it for 'plaintext'
since it is not listed in languagesToExt
:
diff2html/src/ui/js/highlight.js-helpers.ts
Lines 653 to 655 in e5c8139
It would be convenient to be able to register custom language/extension mappings.
👋 Thanks for the contribution. Left a comment in the PR.