Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff of bold, italic, underline and strikethrough differs #85

Open
qstiegler opened this issue Jun 4, 2019 · 5 comments
Open

Diff of bold, italic, underline and strikethrough differs #85

qstiegler opened this issue Jun 4, 2019 · 5 comments

Comments

@qstiegler
Copy link

qstiegler commented Jun 4, 2019

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.

@SavageTiger
Copy link
Contributor

Could you check if this problem still persist in the latest version?

@ghry5
Copy link

ghry5 commented Jun 7, 2022

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.

@SavageTiger
Copy link
Contributor

@ghry5 Would you have a left and right text and an expected and actual result? that would make this easier to reproduce.

@ghry5
Copy link

ghry5 commented Jun 8, 2022

  1. <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>

  2. <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:

  1. <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>

  2. <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>

@SavageTiger
Copy link
Contributor

SavageTiger commented Jun 11, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants