-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2381 from ckeditor/t/2294
Fixed issues with applying inline styles to HTML comments
- Loading branch information
Showing
8 changed files
with
141 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
<div id="playground" contenteditable="true"></div> | ||
<textarea name="html-comments-bold" id="html-comments-bold"> | ||
<p>foo</p><!--/end logo --><p> </p><!-- begin: body --><p>a<br />a</p> | ||
=> | ||
<p><strong>foo</strong></p> | ||
<!--/end logo --> | ||
<p><strong> </strong></p> | ||
<!-- begin: body --> | ||
<p><strong>a<br />a</strong></p> | ||
</textarea> | ||
|
||
<textarea name="html-comments-between-blocks" id="html-comments-between-blocks"> | ||
<p>foo</p><!-- com --><p>bar</p> | ||
=> | ||
<p><strong>foo</strong></p> | ||
<!-- com --> | ||
<p><strong>bar</strong></p> | ||
</textarea> | ||
|
||
<textarea name="html-comments-between-inline" id="html-comments-between-inline"> | ||
<p><em>foo</em><!-- com --><em>bar</em></p> | ||
=> | ||
<p> | ||
<strong> | ||
<em>foo</em> | ||
<!-- com --> | ||
<em>bar</em> | ||
</strong> | ||
</p> | ||
</textarea> | ||
|
||
<textarea name="html-comments-tailing-inline" id="html-comments-tailing-inline"> | ||
<p> | ||
foo | ||
<!-- com --> | ||
</p> | ||
=> | ||
<p> | ||
<strong>foo</strong> | ||
<!-- com --> | ||
</p> | ||
</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<textarea name="html-comments-bold" id="html-comments-bold"> | ||
[<p>foo</p> | ||
<!--/end logo --> | ||
<p> </p> | ||
<!-- begin: body --> | ||
<p>a<br />a</p>] | ||
=> | ||
<p><strong>foo</strong></p> | ||
<!--/end logo --> | ||
<p><strong> </strong></p> | ||
<!-- begin: body --> | ||
<p><strong>a<br />a</strong></p> | ||
</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<textarea cols="80" id="editor1" name="editor1" rows="10"> | ||
<p>foo</p> <!--/end logo --> <p> </p> <!-- Begin: Body --> <p>a<br />a</p> | ||
</textarea> | ||
|
||
<script> | ||
if ( bender.tools.env.mobile ) { | ||
bender.ignore(); | ||
} | ||
|
||
CKEDITOR.replace( 'editor1' ); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@bender-tags: bug, 2294, 2380, 4.10.2 | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: wysiwygarea, toolbar, basicstyles, sourcearea, htmlwriter | ||
|
||
1. Open the console. | ||
1. Focus the editor. | ||
1. Select all the contents (`ctrl/cmd+a`). | ||
1. Click the "Bold" button in the toolbar. | ||
|
||
### Expected | ||
|
||
No errors are thrown in the console. | ||
|
||
### Actual | ||
|
||
JS error is thrown, like `Uncaught TypeError: Cannot read property 'getParents' of null` | ||
|
||
1. Click the "Source" button. | ||
|
||
### Expected | ||
|
||
HTML comments that are ouside of paragraphs, are not wrapped with additional `p` or `strong` tags. | ||
|
||
### Actual | ||
|
||
Additional markup is created around HTML comments. | ||
|
||
### Notes | ||
|
||
[Edge will throw `Permission denied` exception](https://github.com/ckeditor/ckeditor-dev/issues/2035), this particular error is not related to this test. |