-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fixed issues with applying inline styles to HTML comments #2381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no manual test for #2380. It could be even added as additional step to existing one as it's basically checking the source of the editor.
@@ -0,0 +1,20 @@ | |||
@bender-tags: bug, 2296, 4.10.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I'm going to mix these two till the end of time. 😉 Fixed in 586cf64.
tests/core/style/applyremove.js
Outdated
test_inline_nobreak1: function() { | ||
playground.setHtml( 'this is <a href="http://example.com/">some sample</a> text' ); | ||
|
||
var range = new CKEDITOR.dom.range( doc ); | ||
range.setStart( playground, 0 ); | ||
range.setEnd( playground.getChild( 1 ).getFirst(), 4 ); | ||
|
||
playground.trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed? Checked in Chrome, Firefox, Safari and IE 8 – nothing failed without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's no longer needed. It was just a leftover I made when cleaning up markup for IE8. Several tests required to strip bounding whitespaces, as otherwise extra paragraphs were created. Dropped in 5fca69d.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…few simplifications the content was gone. I'll probably simplify it in next commits.
Now it starts to look nice.
…them with the style. The reason is to simply produce a cleaner markup.
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
What changes did you make?
While checking #2294 bug I found that HTML comments are badly handled.
First I had a fix in 85b89ec - which fixed the issue requested in #2294 but I wasn't quite happy about the way how it did it. For instance, applying strong to the following HTML:
Would result with:
It could be acceptable to some extend, but it's pretty dirty HTML nontheless so I dig deeper, and after some further checking I was able to create a more clean result:
Also you might note that in 7da825e I have reverted some refactoring. Imho name
checkIfTextOrReadonlyOrEmptyElement
is not the prettiest, personally I'd use sth likeif ( isText( foo ) || isReadonly( foo ) || ( isEmpty( foo ) and isElement( foo ) ) )
- but decided to revert it, to make just essential changes (except some doc typos cleanup).Closes #2294 and closes #2380.