DLynch has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/393932 )
Change subject: ce.Surface: more tests for Google Docs pasting
......................................................................
ce.Surface: more tests for Google Docs pasting
Bug: T145252
Change-Id: Ia51cc6f8eb5d90e8f8a1a496a0a166254c694cf5
---
M src/ce/ve.ce.Surface.js
M tests/ce/ve.ce.Surface.test.js
2 files changed, 13 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/32/393932/1
diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 0f35d77..ae35351 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -2048,11 +2048,11 @@
if ( node.style.fontStyle === 'italic' ) {
$node.wrap( '<i>' );
}
- if ( node.style.textDecoration === 'underline' ) {
+ if ( node.style.textDecorationLine === 'underline' ) {
$node.wrap( '<u>' );
}
- if ( node.style.textDecoration === 'strikethrough' ) {
- $node.wrap( '<del>' );
+ if ( node.style.textDecorationLine === 'line-through' )
{
+ $node.wrap( '<s>' );
}
if ( node.style.verticalAlign === 'super' ) {
$node.wrap( '<sup>' );
diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js
index 6cdc1fb..7d5e95b 100644
--- a/tests/ce/ve.ce.Surface.test.js
+++ b/tests/ce/ve.ce.Surface.test.js
@@ -2049,7 +2049,7 @@
},
{
rangeOrSelection: new ve.Range( 1 ),
- pasteHtml: '<span style="font-weight:700;
font-style:italic;">A</span>',
+ pasteHtml: '<span
style="font-weight:700;">A</span><span style="font-style:italic;">B</span><span
style="text-decoration:underline">C</span><span
style="text-decoration:line-through;">D</span><span
style="vertical-align:super;">E</span><span
style="vertical-align:sub;">F</span><span style="font-weight:700;
font-style:italic;">G</span><span style="color:red;">H</span>',
fromVe: true,
expectedOps: [
[
@@ -2057,14 +2057,21 @@
{
type: 'replace',
insert: [
- [ 'A', [ {
type: 'textStyle/bold', attributes: { nodeName: 'b' } }, { type:
'textStyle/italic', attributes: { nodeName: 'i' } } ] ]
+ [ 'A', [ {
type: 'textStyle/bold', attributes: { nodeName: 'b' } } ] ],
+ [ 'B', [ {
type: 'textStyle/italic', attributes: { nodeName: 'i' } } ] ],
+ [ 'C', [ {
type: 'textStyle/underline', attributes: { nodeName: 'u' } } ] ],
+ [ 'D', [ {
type: 'textStyle/strikethrough', attributes: { nodeName: 's' } } ] ],
+ [ 'E', [ {
type: 'textStyle/superscript', attributes: { nodeName: 'sup' } } ] ],
+ [ 'F', [ {
type: 'textStyle/subscript', attributes: { nodeName: 'sub' } } ] ],
+ [ 'G', [ {
type: 'textStyle/bold', attributes: { nodeName: 'b' } }, { type:
'textStyle/italic', attributes: { nodeName: 'i' } } ] ],
+ 'H'
],
remove: []
},
{ type: 'retain', length: 29 }
]
],
- expectedRangeOrSelection: new ve.Range( 2 ),
+ expectedRangeOrSelection: new ve.Range( 9 ),
msg: 'Span cleanups: style converted into
markup'
},
{
--
To view, visit https://gerrit.wikimedia.org/r/393932
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia51cc6f8eb5d90e8f8a1a496a0a166254c694cf5
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits