rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.9k stars 280 forks source link

set highlight language with `highlightLanguage` option #438

Closed quentin closed 1 year ago

quentin commented 2 years ago

Add option highlightLanguage to set the highlight language. Default value is '' to select the language based on the diffed filename extension.

This is related to #437.

rtfpessoa commented 2 years ago

👋 @quentin thanks for your contribution. It looks good over all, but would be nice if we could pass a map instead of the string. The map could be from extension -> language and that way we could support multiple extensions and even overrides. Would you be able to adjust the PR?