Closed scratchyone closed 2 years ago
hi, just pinging @WillHayCode for visibility since this bug causes problems on a fair amount of websites
From what I can tell from the issue descriptions, this PR should also close https://groups.google.com/u/3/g/deadname-remover/c/UxI06q2pyD0, #339, and https://groups.google.com/u/3/g/deadname-remover/c/llOhITI0hAY.
Hi @scratchyone ! I recently took over maintenance of this extension and wanted to follow up and let you know I'm planning on reviewing this PR within the next couple days. I appreciate your contribution and will be in touch here!
This looks great @scratchyone , thanks for the PR! Adding this into a 2.0.0 branch; hoping to push a good number of commits as part of that release, which includes refactoring code. For the time being, I'm planning on not commiting to master and putting effort into that 2.0.0 release.
If you've got capacity and interest in being a co-maintainer, definitely let me know! Especially during this transition phase, I'm trying to find a good way to balance the workload of this repo with my schedule 😜
Previously, the extension would set the parent innerHTML to update a child text node. If the parent had other child elements as well as the text node, the child elements would be inadvertently deleted. I've noticed this causing issues on a few websites.
This PR fixes that by instead modifying the text nodes
nodeValue
. If highlighting is enabled, the new behavior is instead to create a new empty element, replace the old element with it, and then set theouterHTML
of the new element tonewText
, which has the outcome of replacing the text node in place with a new mark element.This PR also fixes an unrelated issue that was causing thousands of mark tags to be generated because
replaceText
would wrap every item inoldWords
in another set of mark tags every time it was called.