Closed redrabbit closed 5 years ago
Commit 9185553 helped quite a lot here.
The docs state that you can pass a variable to keep track of the parsing state 🤓.
There are still some differences when parsing the entire code (not chunked by lines). Will investigate if there is a possible fix.
Code parsed line by line within <table>
:
Code parsed entirely in a <pre
> block:
You can see that geef_diff_tree
is highlighted correctly in the second screenshot.
Commit 0518014 fixes the issue explained in the last comment. Page loading feels somehow slower.
A benefit of this workaround is that we can detect the language of the entire block instead of trying to guess line by line.
Concatenating all line, parsing them and reflecting the result for each row in the <table>
is also a bit cumbersome. Current implementation is not perfect and some brings other issues...
Syntax highlighting before 0518014:
Syntax highlighting after 0518014:
Instead of using
<table>
for rendering highlighted code (we do so because we display a<td>
column for each line).We should use a different layout allowing highlight.js to parse entire blocks.templates/codebase/_blob_table.html.eex
.templates/codebase/_diff_table.html.eex
.