[Question] Is it possible to use diff2html just for code highlighting?
Hello,
In some specific cases along with diff-view I need to show code as-is, and I want to show it in the same way as diff-view doing it.
Right now I using some tricky solution where I creating patch compared with empty string:
var diff = JsDiff.createPatch('Diff Name', '', code_here, '', '');
var diff2htmlUi = new Diff2HtmlUI({diff: diff});
diff2htmlUi.draw('#line-by-line', {inputFormat: 'diff', outputFormat: 'line-by-line', showFiles: false, matching: 'lines'});
diff2htmlUi.highlightCode('#line-by-line');
And it works in following way:

And it's okay for me, but in this case I would like to remove these two UI elements (header and "newline" marks) and left only line number and code:

Is there any way to achieve that using this approach, or we have some better way to do that.
Thanks.
I hope that I can do it using template overrides for these specific cases, but maybe we have some better way to do that?
With a first look I think you could do that with overriding generic-line to remove the prefixes, then disabling the comparison of lines and also removing the header line from the json. Let me know if you need any other tips.
@rtfpessoa, thanks a lot. That's all what I need.