File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,6 +82,14 @@ function registerEditListeners() {
8282 }
8383 }
8484 this . setSelectionRange ( newStart , Math . max ( newStart , newEnd ) ) ;
85+ } ) . on ( "paste" , function ( e ) {
86+ e . preventDefault ( ) ;
87+ // This is a bug when copying from PowerPoint, where '\n' is
88+ // replaced with '\v' (vertical tab) and ' ' is replaced with '\xa0' (non-breaking space)
89+ const text = e . originalEvent . clipboardData . getData ( "text" )
90+ . replaceAll ( String . fromCharCode ( 11 ) , "\n" )
91+ . replaceAll ( String . fromCharCode ( 160 ) , " " ) ;
92+ document . execCommand ( "insertText" , false , text ) ;
8593 } ) ;
8694}
8795
Original file line number Diff line number Diff line change 1414 {
1515 "title" : " Fixes" ,
1616 "items" : [
17- " Tab key will no longer clear input history"
17+ " Tab key will no longer clear input history" ,
18+ " Compatibility issue with Microsoft PowerPoint"
1819 ]
1920 }
2021 ]
You can’t perform that action at this time.
0 commit comments