Hey there! I wanted to offer an addition I recently made to this package that gives the ability to ignore HTML classes. I found that some javascript packages require a lot of control over the DOM, and smartquotes was interfering with their performance. For example, some text editors, like react-quill and slate, do not correctly select text while the smartquotes listener is running.
My approach was to mark any DOM nodes that are descendants of an Ignored class and skip them in the element handler. There may be a better way to do this, but I hacked this together and it seems to work well enough. I haven't noticed any performance issues with the additional node parsing. However, it's conceivable that if a user ignores large subtrees, then the recursive node marking may slow things down.
The API interface isn't very readable, but it is backwards compatible. I'm open to changing the format to make it easier to pass in additional options, etc. but didn't want to submit a breaking change without more context.
Hey there! I wanted to offer an addition I recently made to this package that gives the ability to ignore HTML classes. I found that some javascript packages require a lot of control over the DOM, and
smartquotes
was interfering with their performance. For example, some text editors, likereact-quill
andslate
, do not correctly select text while thesmartquotes
listener is running.My approach was to mark any DOM nodes that are descendants of an Ignored class and skip them in the element handler. There may be a better way to do this, but I hacked this together and it seems to work well enough. I haven't noticed any performance issues with the additional node parsing. However, it's conceivable that if a user ignores large subtrees, then the recursive node marking may slow things down.
The API interface isn't very readable, but it is backwards compatible. I'm open to changing the format to make it easier to pass in additional options, etc. but didn't want to submit a breaking change without more context.