Skip to content

Commit bde01c9

Browse files
committed
Merge branch 't/9330'
2 parents acaffaa + cbc0fa2 commit bde01c9

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ CKEditor 4 Changelog
33

44
## CKEditor 4.2.1
55

6+
* [#9330](http://dev.ckeditor.com/ticket/9330): Fixed pasting anchors from MS Word.
67
* [#8103](http://dev.ckeditor.com/ticket/8103): Fixed pasting nested lists from MS Word.
78
* [#10662](http://dev.ckeditor.com/ticket/10662): Fixed styles from Styles drop-down list not registered to the ACF in case when [Shared Spaces plugin](http://ckeditor.com/addon/sharedspace) is used.
89
* [#9654](http://dev.ckeditor.com/ticket/9654): Problems with IE10 Quirks mode.

plugins/pastefromword/filter/default.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -952,21 +952,20 @@
952952
},
953953

954954
// Migrate basic style formats to editor configured ones.
955-
'b': elementMigrateFilter( config[ 'coreStyles_bold' ] ),
956-
'i': elementMigrateFilter( config[ 'coreStyles_italic' ] ),
957-
'u': elementMigrateFilter( config[ 'coreStyles_underline' ] ),
958-
's': elementMigrateFilter( config[ 'coreStyles_strike' ] ),
959-
'sup': elementMigrateFilter( config[ 'coreStyles_superscript' ] ),
960-
'sub': elementMigrateFilter( config[ 'coreStyles_subscript' ] ),
961-
// Editor doesn't support anchor with content currently (#3582),
962-
// drop such anchors with content preserved.
963-
'a': function( element ) {
955+
b: elementMigrateFilter( config[ 'coreStyles_bold' ] ),
956+
i: elementMigrateFilter( config[ 'coreStyles_italic' ] ),
957+
u: elementMigrateFilter( config[ 'coreStyles_underline' ] ),
958+
s: elementMigrateFilter( config[ 'coreStyles_strike' ] ),
959+
sup: elementMigrateFilter( config[ 'coreStyles_superscript' ] ),
960+
sub: elementMigrateFilter( config[ 'coreStyles_subscript' ] ),
961+
962+
// Remove full paths from links to anchors.
963+
a: function( element ) {
964964
var attrs = element.attributes;
965-
if ( attrs && !attrs.href && attrs.name )
966-
delete element.name;
967-
else if ( CKEDITOR.env.webkit && attrs.href && attrs.href.match( /file:\/\/\/[\S]+#/i ) )
968-
attrs.href = attrs.href.replace( /file:\/\/\/[^#]+/i, '' );
965+
if ( attrs.href && attrs.href.match( /^file:\/\/\/[\S]+#/i ) )
966+
attrs.href = attrs.href.replace( /^file:\/\/\/[^#]+/i, '' );
969967
},
968+
970969
'cke:listbullet': function( element ) {
971970
if ( element.getAncestor( /h\d/ ) && !config.pasteFromWordNumberedHeadingToList )
972971
delete element.name;

0 commit comments

Comments
 (0)