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 fails on image as a link inside a table #110

Open
sebreb opened this issue Jun 24, 2022 · 0 comments
Open

Diff fails on image as a link inside a table #110

sebreb opened this issue Jun 24, 2022 · 0 comments
Labels

Comments

@sebreb
Copy link

sebreb commented Jun 24, 2022

Hello and thank you for this awesome library!
I am reporting an issue tested in https://php-htmldiff.caxy.com/.
The diff doesn't detect the left image deletion in the following 2-cells-table:

OLD

<table>
    <tbody>
        <tr>
            <td><a href="#somewhere"><img src="https://fr.wikipedia.org/static/images/mobile/copyright/wikipedia.png"/></a></td>
            <td><img src="https://fr.wikipedia.org/static/images/mobile/copyright/wikipedia.png"/></td>
        </tr>
    </tbody>
</table>

NEW

<table>
    <tbody>
        <tr>
        <td></td>
        <td><img src="https://fr.wikipedia.org/static/images/mobile/copyright/wikipedia.png"/></td>
        </tr>
    </tbody>
</table>

RESULT

<table>
    <tbody>
        <tr>
            <td rowspan="1" colspan="1">
                <a href="#somewhere" class="diffmod">
                    <img src="https://fr.wikipedia.org/static/images/mobile/copyright/wikipedia.png" alt="wikipedia.png">
                </a>
                <del class="diffmod"> </del>
                <ins class="diffmod"></ins>
            </td>
            <td rowspan="1" colspan="1">
                <img src="https://fr.wikipedia.org/static/images/mobile/copyright/wikipedia.png" alt="wikipedia.png">
            </td>
        </tr>
    </tbody>
</table>
  • If I extract the first image from tag or if I add a space inside this tag, the deletion is detected inside the cell.
  • If I remove the second column in both OLD and NEW, the deletion of the left image link is detected at the level.

I would like the diff to detect the image deletion, does anybody know how to achieve this goal ?
Thank you in advance,

@sebreb sebreb changed the title Diff fails on image as a link in a table Diff fails on image as a link inside a table Jun 24, 2022
@jschroed91 jschroed91 added the Bug label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants