Goal:
Enable user to highlight article text and be taken directly to that text in the Native Editor
Requirements:
- After highlighting a word, and tapping edit in the contextual menu the NativeEditor appears and scrolls directly to the word that you highlighted.
Testing notes
- Select text in article. Tap "Edit" in contextual menu.
- Confirm editor scrolls to the correct selected spot upon load.
This feature existed before, so you can compare and regression test against the current App Store build.
Engineering note
For this to work, we must currently do some wild html > wikitext conversion regex somewhere in our javascript, but it works surprisingly well!
This task is to dig up that javascript and reuse it if possible. Allow the native editor to be passed in a “scroll to this html” string, and it will do it’s best to find it (with our old javascript regex converted to native regex) and scroll to it.
The area of interest for porting is highlightAndScrollToWikitextForSelectedAndAdjacentText in codemirror-editTextSelection.js.