wikipendium / wikipendium.no

Compendiums edited as a wiki.
https://www.wikipendium.no
Apache License 2.0
36 stars 5 forks source link

Diff algorithm ignores HTML spec #43

Closed stianjensen closed 11 years ago

stianjensen commented 11 years ago

We get some crazy results in the rendering of some diffs, due to and tags being inserted at crazy places in the DOM.

Example:

<del class="diff modified"><h3 id="relational-algebra"></del>
<ins class="diff modified"><h1 id="relational-algebra"></ins>
Relational algebra<del class="diff modified"></h3>

<h4 id="primitive-operators"></del><ins class="diff modified"></h1>

<h2 id="primitive-operators"></ins> Primitive operators
<del class="diff modified"></h4></del>
<ins class="diff modified"></h2></ins>

This gives a rather confusing result:

screen shot 2013-05-10 at 18 17 45

sigvef commented 11 years ago

Hm. Perhaps if we diff the markdown instead of the html?

stianjensen commented 11 years ago

That might work.