OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
678 stars 95 forks source link

insertText: Weird behavior when inserting vertical tabulation ("\v") #2 #4275

Open dhoelzl opened 7 months ago

dhoelzl commented 7 months ago

This is a follow-up issue from https://github.com/OfficeDev/office-js/issues/1755.

The problem seems to be only partially fixed, the test case 3 still does not work, it still behaves like before.

Tested on office.com (Version 16.0.17514.41008).

Reproduction:

In an extension context on office.com run

await Word.run(async (context) => {
   var sourceRange = context.document.getSelection();
   sourceRange.insertText("Test\nTest\vLine\vBreak\nTest", 'Replace');
   await context.sync();
});

this inserts

Test¶

Test\vLine\vBreak¶

Test

(Output is formatted as displayed in Word with the option to display invisible characters enabled).

Expected:

Test¶

Test↵
Line↵
Break¶

Test
microsoft-github-policy-service[bot] commented 7 months ago

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

zhenhuangMSFT commented 7 months ago

Thanks for re-opening the issue! We are still tracking the bug with 5008299.