4 ms·
Does it also work when the syntax is outside of the diff context? I.e. think a html comment that started in an a prior insertion hunk? We had encountered a lot
by zsombor 13y ago
Does it also work when the syntax is outside of the diff context? I.e. think a html comment that started in an a prior insertion hunk? We had encountered a lot of edge cases whilst building the syntax highlighted diffs for https://www.tixef.com https://www.tixef.com It is a tricky domain, hats of to you for attempting it in JavaScript!
- DanielRibeiro 13y agoThanks! The highlihght is pretty much constrained to diff (on pull requests, commits and compares[1]), but it could work on any page. I've mentioned[2] how I used jquery-syntaxhighlighter to do it, which itself is a fork of Google's Prettify in order to do the heavy lifting of syntax discovery and actual highlight. [1] https://github.com/danielribeiro/github-diff-highlight/blob/master/src/header.js#L2 https://github.com/danielribeiro/github-diff-highlight/blob/... [2] https://github.com/danielribeiro/github-diff-highlight#hacking https://github.com/danielribeiro/github-diff-highlight#hacki...
- eru 13y agoJust a naive question: Couldn't you highlight the two (or three) original sources, and then use that information to highlight the diff? Instead of trying to highlight the diff directly.