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

Pasting anchors give strange behavior #500

Closed
fredck opened this issue Jul 10, 2017 · 7 comments
Closed

Pasting anchors give strange behavior #500

fredck opened this issue Jul 10, 2017 · 7 comments
Assignees
Labels
package:engine package:link type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@fredck
Copy link
Contributor

fredck commented Jul 10, 2017

I have copied the contents of the following page in the online demo:
https://aws.amazon.com/aup/

The headers inside the text are anchor links (<a name="...">).

When pasting it inside the online demo, some strange things happen:

  • The titles get styled like a link. They shouldn't because these are not links but anchors.
  • Still the link balloon doesn't show up :/
  • Clicking on these links gives the impression that we're constantly breaking words in parts. In fact, the spell checking underline goes a bit crazy with it.
  • The above can be also noticed when hovering with the caret inside the link. It looks like broken at the caret position.

jul-10-2017 14-39-54

The expected result is that such anchors will not be pasted, just the plain text of the headers. Unless the still not existing anchor feature is available, ofc.

@Reinmar
Copy link
Member

Reinmar commented Jul 10, 2017

This is what we get from the clipboard:

 <meta charset='utf-8'><div class="lead-copy" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: HelveticaNeue, Helvetica, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><div class="lead" style="box-sizing: border-box; font-size: 1.28em; font-weight: 200; line-height: 1.6em; margin-bottom: 30px; font-family: HelveticaNeueLight, Helvetica, Helvetica, Arial, sans-serif;"><p style="box-sizing: border-box; margin: 0px 0px 0.8em;">use of the Services.<br style="box-sizing: border-box;"></p></div></div><div class="content parsys" style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: HelveticaNeue, Helvetica, Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><div class="title section row" style="box-sizing: border-box; width: auto; max-width: none; margin: 0px -10px 15px; min-width: 0px;"><div class="twelve columns" style="box-sizing: border-box; float: left; min-height: 2px; padding: 0px 10px; position: relative; width: 879px;"><h3 id="No_Illegal,_Harmful,_or_Offensive_Use_or_Content" style="box-sizing: border-box; margin: 0px; line-height: 1.3em; color: rgb(31, 61, 92); text-rendering: optimizeLegibility; font-family: HelveticaNeue, Helvetica, Helvetica, Arial, sans-serif; font-size: 1.4em; font-weight: 300;"><a name="No_Illegal,_Harmful,_or_Offensive_Use_or_Content" style="box-sizing: border-box; color: inherit; text-decoration: none; cursor: pointer;">No Illegal, Harmful, or Offensive Use or Content</a></h3></div></div><div class="text section" style="box-sizing: border-box; margin-bottom: 25px; font-family: HelveticaNeue, Helvetica, Helvetica, Arial, sans-serif !important;"><p style="box-sizing: border-box; margin: 0px 0px 0.8em;">You ma</p></div></div>

A soup, but digestive.

This is what we get initially in the editable (first bug):

image

And this is even worse – after clicking in the middle of the text the filler gets inserted (second bug):

image

Both bugs are pretty bad.

@Reinmar
Copy link
Member

Reinmar commented Jul 10, 2017

I think that the second issue is a result of the first issue because the same thing doesn't happen when the link is properly converted from the model. Still, we should understand why all this happens.

@Reinmar
Copy link
Member

Reinmar commented Jul 11, 2017

The second issue I described may be the cause of #502.

@Reinmar
Copy link
Member

Reinmar commented Jul 13, 2017

The supposed fix for #502 doesn't help for this issue and since we have just one attribute element here I suppose that #502 is completely unrelated.

@Reinmar
Copy link
Member

Reinmar commented Jul 13, 2017

The fix for link converter is in https://github.com/ckeditor/ckeditor5-link/issues/139. Now checking why the link gets split (the link isn't split of course if it gets converted correctly).

@Reinmar
Copy link
Member

Reinmar commented Jul 13, 2017

I reported https://github.com/ckeditor/ckeditor5-engine/issues/1013 and I don't think that it makes sense to actually think what broke there because the issue is caused by the value of the attribute being undefined. If it's any other kind of falsy value, everything works fine.

@oleq
Copy link
Member

oleq commented Jul 14, 2017

https://github.com/ckeditor/ckeditor5-link/issues/139 resolved this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:link type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants