Open jamespeacock opened 6 years ago
Will create tests to cover this new usage if you let me know whether this is an acceptable addition to the Keyword Processor.
Additionally, perhaps this could be a separate method that takes in a 'prepend' and an 'append' rather than a 'replacement' and this could eliminate the need for str.replace() in keyword.py:644
For any use case where the goal is to preserve the original text keyword and prepend/append to it, these changes allow for that without replacing the original text with the perhaps differently cased keyword text that matches.
For HTML highlighting in particular, this will be incredibly useful.
These code changes do not affect any other use case, and the custom replacement is optional. I have also included an example in the README for how this could be used.