Skip to content
Permalink
Browse files

Merge branch 't/16912' into major

  • Loading branch information...
mlewand committed Apr 18, 2017
2 parents 6a12bf0 + 2e2c351 commit 8f388d22d1bb9df234708c1c4e10ec66e970708c
@@ -12,6 +12,7 @@ New Features:

Fixed Issues:

* [#16912](http://dev.ckeditor.com/ticket/16912): Fixed: Exception thrown when a single image is pasted using [paste from Word](http://ckeditor.com/addon/pastefromword).
* [#16935](http://dev.ckeditor.com/ticket/16935): Fixed: [Chrome] Blurring editor in [Source Mode](http://ckeditor.com/addon/sourcearea) throws an error.
* [#13381](http://dev.ckeditor.com/ticket/13381): Fixed: Dynamic code evaluation call in [`CKEDITOR.template`](http://docs.ckeditor.com/#!/api/CKEDITOR.template) removed. CKEditor can be used with `unsafe-inline` Content Security Policy. Thanks to [Caridy Patiño](http://caridy.name)!
* [#16825](http://dev.ckeditor.com/ticket/16825): Fixed: [Chrome] Error thrown when destroying focused inline editor.
@@ -95,7 +95,8 @@
}
};

if ( element.parent ) {
// If the parent is DocumentFragment it does not have any attributes. (#16912)
if ( element.parent && element.parent.attributes ) {
var attrs = element.parent.attributes,
style = attrs.style || attrs.STYLE;
if ( style && style.match( /mso\-list:\s?Ignore/ ) ) {
@@ -0,0 +1,16 @@
<textarea name="editor1" id="editor1" cols="30" rows="10">
<h1>
<img alt="Saturn V carrying Apollo 11" class="right" src="%BASE_PATH%_assets/lena.jpg" /> Apollo 11
</h1>

<p>
<strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans
<a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a>
, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours
later on July 21 at 02:56 UTC.
</p>
</textarea>

<script>
CKEDITOR.replace( 'editor1' );
</script>
@@ -0,0 +1,12 @@
@bender-tags: tc, 4.7.0, 16912
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, undo, basicstyles, pastefromword, elementspath, image, format

1. Select the image.
1. Copy it (`ctrl/cmd + c` or `Copy` button).
1. Put caret somewhere else.
1. Paste the image as `Word` (Click `Paste from Word` button and follow the instructions).

**Expected:** Image is pasted.

**Unexpected:** Image is not pasted, error is thrown in the console.
@@ -0,0 +1,41 @@
<textarea id="root-image">
<html>
<head></head>
<body>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right">
</body>
</html>
=>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right" />
</textarea>

<textarea id="root-image-simple">
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right">
=>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right" />
</textarea>

<textarea id="nested-image">
<html>
<head></head>
<body>
<h1>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right"> Apollo 11
</h1>
</body>
</html>
=>
<h1>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right" /> Apollo 11
</h1>
</textarea>

<textarea id="nested-image-simple">
<h1>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right"> Apollo 11
</h1>
=>
<h1>
<img alt="Saturn V carrying Apollo 11" data-cke-saved-src="assets/sample.jpg" src="assets/sample.jpg" class="right" /> Apollo 11
</h1>
</textarea>
@@ -0,0 +1,31 @@
/* bender-tags: editor,unit,clipboard,pastefromword */
/* bender-ckeditor-plugins: pastefromword */

( function() {
'use strict';

bender.editor = true;

function testOutput( name, editor ) {
bender.tools.testInputOut( name, function( input, output ) {
bender.assert.beautified.html( output, CKEDITOR.cleanWord( input, editor ) , name );
} );
}

CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( '/plugins/pastefromword/filter/default.js' ), function() {
bender.test( {
init: function() {
this.isCustomDataTypesSupported = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported;
},

// (#16912)
'test root image': function() {
testOutput( this.isCustomDataTypesSupported ? 'root-image' : 'root-image-simple', this.editor );
},

'test nested image': function() {
testOutput( this.isCustomDataTypesSupported ? 'nested-image' : 'nested-image-simple', this.editor );
}
} );
}, null, true );
} )();

0 comments on commit 8f388d2

Please sign in to comment.
You can’t perform that action at this time.