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

Feature Request - Ignore specific nodes #2

Open
DannyFeliz opened this issue Nov 16, 2023 · 2 comments
Open

Feature Request - Ignore specific nodes #2

DannyFeliz opened this issue Nov 16, 2023 · 2 comments

Comments

@DannyFeliz
Copy link

Hi, I was about to start developing something like this and then I found your package, it works great but there's a use case I have, there are some elements that I want to be read-only, so the replacement shouldn't affect these elements, so it would be nice if we could define a line of node to ignore, so the replacer skips these nodes.

@sereneinserenade
Copy link
Owner

Seems like a great feature, I'll get to it in next couple of weeks. Thinking about adding an option called ignoredNodes: string[].

For now: returning false for the nodes to ignore in the doc?.descendants should do the trick.

doc?.descendants((node, pos) => {
if (node.isText) {
if (textNodesWithPosition[index]) {

@DannyFeliz
Copy link
Author

Thank you very much, I will do that in the meantime, then when you add the feature I will get rid of my modification.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants