Use rare unicode characters for paste placeholders

Helps with bug reporting, like the snowman and pawn.

Change-Id: Id133431eea987442c8b50a05821ebd54649b26b9
This commit is contained in:
Thalia 2013-11-07 14:30:41 +00:00 committed by Ed Sanders
parent 7cec9ae04a
commit 65aab78d3b
2 changed files with 5 additions and 5 deletions

View file

@ -794,19 +794,19 @@ ve.ce.Surface.prototype.beforePaste = function ( e ) {
// If there is content to the left of the cursor, put a placeholder
// character to the left of the cursor
if ( selection.start > range.start ) {
leftText = 'A';
leftText = '';
context.push( leftText );
textStart = textEnd = 1;
}
// If there is content to the right of the cursor, put a placeholder
// character to the right of the cursor
if ( selection.end < range.end ) {
rightText = 'B';
rightText = '';
context.push( rightText );
}
// If there is no text context, select some text to be replaced
if ( !leftText && !rightText ) {
context.push( 'C' );
context.push( '' );
textEnd = 1;
}
context.push( { 'type': '/' + context[0].type } );

View file

@ -445,14 +445,14 @@ QUnit.test( 'beforePaste/afterPaste', function ( assert ) {
},
{
'range': new ve.Range( 4 ),
'pasteTargetHtml': 'BfooA',
'pasteTargetHtml': '☂foo☀',
'expectedRange': new ve.Range( 9 ),
'expectedOps': [
[
{ 'type': 'retain', 'length': 4 },
{
'type': 'replace',
'insert': [ 'B', 'f', 'o', 'o', 'A' ],
'insert': [ '', 'f', 'o', 'o', '' ],
'remove': []
},
{ 'type': 'retain', 'length': 5 }