-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
How to "replaceWith" on plain text, which is not a DOM Elements? #3411
Comments
hi there, |
Can you tell me in which file this issue occurs. |
Yes, lets say I get an article from a CMS, it can contain HTML like |
Ok i got it ,I am Looking for existing file where this existing code is written as i am unable to find code where i have to make changes |
Can you tell me in which file the changes needs to be made ? |
Your best bet is likely to find the const text = $('body').get(0).childNodes[0]
text.data = text.data.replace('Ipsum', 'Possum') |
I have the following DIV that needs some replaces:
This loads the string without wrapping the text into
<html><body>
, which must be avoided in my case.I want to do a replacement on "Ipsum" to replace it with a DOM element, like an
<a>
-Element.After that, I want to replace other words as well with related DOM-elements, but never ever touch already replaced words again.
Which filter gives me this feature to work with
replaceWith
?The text was updated successfully, but these errors were encountered: