php-htmldiff icon indicating copy to clipboard operation
php-htmldiff copied to clipboard

lone image inside a paragraph tag

Open sethjfischer opened this issue 7 years ago • 3 comments

Adding or removing a lone image inside a paragraph tag when the paragraph above also has a change doesn't show as an addition or a deletion for the image. Tested on http://php-htmldiff.caxy.com/ with this code:

OLD HTML:

<p>this is a test</p>
<p>new test</p>
<p><img src="https://storage.googleapis.com/gweb-uniblog-publish-prod/static/blog/images/google-200x200.7714256da16f.png" alt="" /></p>
<p></p>
<p></p>

NEW HTML:

<p>this is a test</p>
<p></p>
<p></p>

sethjfischer avatar Sep 26 '17 20:09 sethjfischer

We've been experiencing the same issue. Our text editor often produces a single img tag in a paragraph. It appears to work fine when there is (for example) other text or whitespace inside the paragraph, but when the paragraph only contains the image there is no <ins> or <del> tag added.

RemkoNolten avatar Mar 24 '21 10:03 RemkoNolten

Also seeing this issue.

bradleyjond avatar Jun 30 '21 18:06 bradleyjond

It's the same here.

Furthermore, when doing the inverse operation, the diff doesn't detect an insertion as shown below. OLD: empty NEW:

<p><img src="https://fr.wikipedia.org/static/images/mobile/copyright/wikipedia.png" alt="wikipedia.png"></p>

sebreb avatar Jun 24 '22 14:06 sebreb