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

Add support for Search and Replace done only for text outside of xhtml elements #220

Open
kevinhendricks opened this issue May 27, 2016 · 3 comments
Assignees

Comments

@kevinhendricks
Copy link
Contributor

@kevinhendricks kevinhendricks commented May 27, 2016

There is a need to more easily support Search and Replace done only for text outside of xhtml elements.
I am thinking of a Text Only checkbox added to search and replace that ignores/removes all element tags/attributes from the material to run search/replace on.

This can actually be done in a limited fashion using regex to restrict the search to being outside of an element "<" to ">" range. But something easier to most users would be nice.

@kevinhendricks
Copy link
Contributor Author

@kevinhendricks kevinhendricks commented May 24, 2021

See this post for example of how to do this via regular expressions until this gets fixed:

https://www.mobileread.com/forums/showpost.php?p=4099971&postcount=169

@UnrulyNatives
Copy link

@UnrulyNatives UnrulyNatives commented Jun 13, 2021

@kevinhendricks
Thank you for your support in adding this feature. It is clearly needed, as there were several attempts to introduce it: #618.
This is a working regex snipped which I got from someone at Stack Overflow: <[^<>]*>(*SKIP)(*F)
https://stackoverflow.com/questions/67846197/sigil-editor-regex-string-to-look-for-a-hyphen-character-in-text-but-not-htm/67858204#67858204

@kevinhendricks
Copy link
Contributor Author

@kevinhendricks kevinhendricks commented Jun 13, 2021

Both seem to work. Now you can save it as a Saved Search and call it up easily whenever you want.

@kevinhendricks kevinhendricks self-assigned this Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants