Opened 8 years ago

Closed 6 years ago

#6920 closed Bug (fixed)

<br /> tags inside links after pressing enter

Reported by: drbrooklyn Owned by:
Priority: Normal Milestone:
Component: UI : Enter Key Version: 3.5
Keywords: Cc:

Description

This bug looks related to #4886, but only happens when:

  1. Change default enter key to produce <br> instead of <p> (I am doing this in Drupal using the ckeditor module settings)
  2. Press enter above an existing link to move it down a linefeed or two.

The output goes from:

<a href="null">text</a>

to

<a href="null">text <br /> <br /> </a>

The expected output should be:

<br /> <br /> <a href="null>text</a>

I verified this on 3.1 and 3.5. This is a serious bug as it breaks the link. The link is blue and underlined when viewing it in ckeditor but is actually broken when viewed with any browser (IE8, FF, Chrome).

Change History (6)

comment:1 Changed 8 years ago by drbrooklyn

Whoops, missing double-quotes in there. That was not intentional.

comment:2 Changed 8 years ago by Garry Yao

Component: GeneralUI : Enter Key
Keywords: link break removed
Status: newconfirmed

Some other users might just want line breaks inside of the created link, so it's an case by case thing and currently in editor there's no option of controlling the exact behavior.

comment:3 in reply to:  2 ; Changed 8 years ago by Paul Veldema

Replying to garry.yao:

Some other users might just want line breaks inside of the created link, so it's an case by case thing and currently in editor there's no option of controlling the exact behavior.

Why would anyone want linebreaks inside a created link?

comment:4 in reply to:  3 Changed 8 years ago by Paul Veldema

Replying to pauljvrw:

Replying to garry.yao:

Some other users might just want line breaks inside of the created link, so it's an case by case thing and currently in editor there's no option of controlling the exact behavior.

Why would anyone want linebreaks inside a created link?

I meant to ask "Why would anyone want linebreaks at the end inside a created link by default?".

I would guess most typed link texts are one or two words or simply the link itself. Therefore most of the time the growing of the link text after an enter at the end of the link text is a nuisence. Should the default therefore not be "enter at the end of a link text then end the link text"?

In case you actually do want line breaks in your link text it should be possible to make something in ckeditor that if the tekst to the left of your cursor is in the link and to right as well that everything you type including enters expands the link tekst. To me that would be more intuitive. In such an implementation you also do not need another configuration option or key combo's and such.

comment:5 Changed 6 years ago by xiltepin

Exactly the same thing happens with <dl><dt><dd> tags. Is there any workaround?

comment:6 Changed 6 years ago by Jakub Ś

Resolution: fixed
Status: confirmedclosed

@xiltepin your issue is about exiting block level elements. This TC is about brs showing up in inline elements. Original issue was fixed and in no longer reproducible in CKEditor 3.6.6 or 4.0.1.

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