Skip to content

How to find and reference the part of the syntax tree that corresponds to currently selected text #166

Answered by ChristianMurphy
jehillert asked this question in Q&A
Discussion options

You must be logged in to vote

Taking a few steps back.
It really sounds like you're building an editing experience more than a pure preview experience.
You may want to consider leveraging an editor framework like slate, which is specifically designed to handle use cases like this https://jkrsp.com/slate-highlight-last-active-selection/
There are also full native options like the ones noted here: https://docs.expo.dev/guides/editing-richtext/#native-editors


Hard requirement ... so native behavior everywhere I don't need a webview

Webview may be an easier entry point for HAST, but it is also possible to translate all content to react native.
A related project in the MDX space you could look at for reference https://g…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@jehillert
Comment options

@ChristianMurphy
Comment options

@jehillert
Comment options

@ChristianMurphy
Comment options

Answer selected by jehillert
@jehillert
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants