0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Ignore IMGs when stripping empty inlines.

When cleaning up pasted content, we remove any empty inline tags. However, we
should not be stripping <img> tags (which are of course both inline and empty).
This commit is contained in:
Neil Jenkins 2013-05-17 17:24:00 +10:00
parent 4c5b157d09
commit 1fbc166226
3 changed files with 3 additions and 3 deletions

View file

@ -2255,7 +2255,7 @@ var removeEmptyInlines = function ( root ) {
child;
while ( l-- ) {
child = children[l];
if ( child.nodeType === ELEMENT_NODE ) {
if ( child.nodeType === ELEMENT_NODE && child.nodeName !== 'IMG' ) {
removeEmptyInlines( child );
if ( isInline( child ) && !child.firstChild ) {
root.removeChild( child );

File diff suppressed because one or more lines are too long

View file

@ -1176,7 +1176,7 @@ var removeEmptyInlines = function ( root ) {
child;
while ( l-- ) {
child = children[l];
if ( child.nodeType === ELEMENT_NODE ) {
if ( child.nodeType === ELEMENT_NODE && child.nodeName !== 'IMG' ) {
removeEmptyInlines( child );
if ( isInline( child ) && !child.firstChild ) {
root.removeChild( child );