rtfpessoa / diff2html

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

Handle case where the language is known but not loaded into HLJS #505

Closed scfrazer closed 10 months ago

scfrazer commented 10 months ago

This PR is in reference to issue #504 . What is happening is:

So my solution below is to check if the language is known (has a map entry), but HLJS doesn't know about it, in which case you fall back to plaintext.

rtfpessoa commented 10 months ago

Thank you for looking into it. I got what you meant. I detected a problem in your logic and issued a fixed version that I locally tested. Fix here https://github.com/rtfpessoa/diff2html/pull/506| Closing this PR in favor of the other one.