James Padolsey

Results 28 comments of James Padolsey

@Darren Sorry for the, urr, delay. I'm interested in how your fix works. In what cases were steps not working? @giacecco Not sure what happened. tbh, oddly, I've never even...

Thanks for writing this up. 👍 Seems like a good idea! I'm pondering a slight re-write of the lib (the code is getting a bit difficult to maintain), and this...

This is by design. To replace DOM with DOM/HTML, you can return a DOM node from the `replace` function. E.g. https://jsfiddle.net/z7Lkw758/

If you could post a JSFiddle of this error that'd be v helpful.

I usually recommend passing a `replace` function if you want finer control over what's replaced. But in this case, a quick hack is much simpler / less painful: ```js findAndReplaceDOMText(document.body,...

Ah whoops. Is `document` a fixed term? Because if so you could just match the entire regex and replace the last capture group with a token, and then replace that...

Maybe on the first pass, instead of replacing it wholesale with a unique token, you can insert unique delimiters and then replace them later: ```js findAndReplaceDOMText(document.body, { find: /(This)(\s+)(document)/g, replace:...

Gonna add this to the 1.0 milestone as I'd like this kind of thing to be simpler in the future and less reliant on hacky code.

Unfortunately this isn't a built-in feature... But it is possible, albeit in a very hacky way. You can create a 'fake' regex-like object (with an `exec` method, like real regexes)...

@giorgio79 `findAndReplaceDOMText` is completely synchronous, so there's no need for a callback. (i.e. it will always have finished running by the time the next line of JS runs). I think...