Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get editor schema #223

Open
PedroPerpetua opened this issue Nov 14, 2024 · 2 comments
Open

Get editor schema #223

PedroPerpetua opened this issue Nov 14, 2024 · 2 comments

Comments

@PedroPerpetua
Copy link

I'm trying to implement some custom behaviour on text selection and processinh HTML; I was attempting to implement the solutions discribed here, however, they require access to the editor's schema. From my investigation into the docs and issues, you can create a custom schema, but there doesn't seem to be a way to obtain said schema at runtime. Is there a way to retrieve this from the editor?

@marcoscarvalho01
Copy link

I'm having the same problem here. I needed to get the current selected content or either use the selection {from,to} object from the editorState to indentify the content. However the from/to number does not have any corresponding indexes in the getText(), getHTML() or getJSON() methods.

A textBetween(from, to) method in the editorBridge would be perfect for such cases.

@17Amir17
Copy link
Collaborator

Currently this is not possible in the built in editor, it is only possible with a custom extension using the advanced setup.
This does seem useful though so will add this to the roadmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants