Move fragment slicing to .js
Jelleas opened this issue · 0 comments
Jelleas commented
The final step of compare50 is render
:
This takes in a collection of Compare50Result
s
Line 297 in 3727b46
And produces the rendered views.
However HTML does not allow for overlapping elements, and the regions (spans) of the file that match may very well overlap. To combat this problem, the RenderTask
slices the code up into fragments like so:
compare50/compare50/_renderer/_renderer.py
Line 293 in 3727b46
In switching to dynamic rendering, this task needs to happen in JavaScript instead. Something like:
function create_fragments(code, spans) => fragments