Opened 6 years ago

Last modified 6 years ago

#10355 confirmed Bug

Remove link-tag in Image-Dialog when Link is empty

Reported by: Alex Schmid Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Webkit Cc:

Description

Currently when an Image nested within a link is edited and the link-url becomes empty the image afterwards still is wrapped in an empty <a> - Tag what maybe is not what should happen.

Reproduced on the demo-page, also on nightly, gives something like:

<a href=""><img alt="Saturn V carrying Apollo 11" class="right" src="assets/sample.jpg" /></a>

I changed this behaviour in plugins/image/dialogs/image.js, ca. Line 397ff by removing the linkElement:

	//Remove Link, Image exists.
	else if ( this.linkEditMode && !this.addLink ) {
		editor.getSelection().selectElement( this.linkElement );
		editor.insertElement( this.imageElement );
		this.linkElement.remove(true); // added
	}						

Change History (1)

comment:1 Changed 6 years ago by Jakub Ś

Keywords: Webkit added
Status: newconfirmed
Version: 4.13.0

I can confirm this is happening in Webkit only. Problem can be reproduced from CKEditor 3.0 in both 4.x (v4) and 3.x branches.

To reproduce:

  1. Paste below code:
    <p><a href=""><img alt="Saturn V carrying Apollo 11" class="right" src="assets/sample.jpg" /></a></p>
    
  2. Switch to wysiwyg
  3. Open image properties dialog and click ok.

Result: only in Webkit a tag will be left untouched.

NOTE: This isn't related to #10224.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy