Diff of bold, italic, underline and strikethrough differs
qstiegler opened this issue · 5 comments
If you compare <p>This is a text</p>
with the same text in bold <p><strong>This is a text</strong></p>
,
the result is <p><del class="diffmod">This is a text</del><strong class="diffmod"><ins class="mod"><ins class="diffmod">This is a text</ins></ins></strong></p>
If you compare <p>This is a text</p>
with the same text in italic <p><em>This is a text</em></p>
,
the result is <p><del class="diffmod">This is a text</del><em class="diffmod"><ins class="diffmod">This is a text</ins></em></p>
If you compare <p>This is a text</p>
with the same text underlined <p><u>This is a text</u></p>
,
the result is <p><u class="diffmod"><ins class="mod">This is a text</ins></u></p>
If you compare <p>This is a text</p>
with the same text struck through <p><u>This is a text</u></p>
,
the result is <p><s class="diffmod"><ins class="mod">This is a text</ins></s></p>
I'm not 100% sure whats the correct way but it should be the same for all of them. I'm not able to style the diff properly.
Could you check if this problem still persist in the latest version?
I can confirm that this problem still exists in the latest version.
For <em>
and <strong>
The diff contains deleting the text and reinserting it in the corresponding tag.
For <u>
and <s>
the diff only adds the diffmod
class to the corresponding tag.
@ghry5 Would you have a left
and right
text and an expected and actual result? that would make this easier to reproduce.
-
<strong>
left
:<p>This is a text</p>
right
:<p><strong>This is a text</strong></p>
actual
:<p><del class="diffmod">This is a text</del><strong class="diffmod"><ins class="diffmod">This is a text</ins></strong></p>
expected
:<p><strong class="diffmod">This is a text</strong></p>
-
<em>
left
:<p>This is a text</p>
right
:<p><em>This is a text</em></p>
actual
:<p><del class="diffmod">This is a text</del><em class="diffmod"><ins class="diffmod">This is a text</ins></em></p>
expected
:<p><em class="diffmod">This is a text</em></p>
As an example following <u>
and <s>
cases to show how i expect it to be:
-
<u>
left
:<p>This is a text</p>
right
:<p><u>This is a text</u></p>
actual
:<p><u class="diffmod">This is a text</u></p>
-
<s>
left
:<p>This is a text</p>
right
:<p><s>This is a text</s></p>
actual
:<p><s class="diffmod">This is a text</s></p>
@ghry5 (cc: @qstiegler) I looked into this issue today and found out that its because of the isolatedDiffTags
in the config, strong
is in that list s
is not for example.
Its always scary to change these types of things, since it means that output will change after an update.
After thinking about it a bit I think the best thing to-do here is to remove the text-styling tags from that list, and just keep the element tags (such as sup
and table
).
Meaning that the changes of styling can be styled by making a css class for diffstyle