context.document.body.text differs depending on platform #5286
Description
context.document.body.text does not always return the text displayed in the document with Word Online.
Your Environment
- Platform : Office on the web
- Host : Word
- Office version number: Word online
- Operating System: Window 10
- Browser : Google Chrome
Expected behavior
The output of the “context.document.body.text” function should remain consistent across all platforms. At present, it displays the text visible in the document’s preview on both Windows and Mac computers. However, this behaviour does not necessarily hold true for Word Online.
Current behavior
When the "Simple Markup" option is selected in Word Online for displaying "Simple Markup" (Review > Markup View > Markup in margin), the deleted text appears in the "context.document.body.text" property , but it is not displayed in Word's document view.
Steps to reproduce
- Open a new document in Word online
- Add text : I eat an apples
- Enable change tracking -> Review > Track Changes > Just Mine
- Delete the 's' character at the end of the word "apples"
- Show marks in the margin -> Review > Markup view > Markup in margin (Simple Markup)
- Get the text with context.document.body.text
The result is -> I eat an apples.
Context
Our plug-in depends on the “context.document.body.text” method to search for text in a document. Unfortunately, this functionality does not work with Word Online when the “Simple Markup” option is enabled.