Open grumpygamer opened 4 years ago
I can't do the replacements after the markdown has been done because it will replace them in code and pre blocks.
You can do this way → https://stackoverflow.com/a/63653055/1163000
Make sure to extend the regex pattern to exclude code elements too:
'/(<code(?:\s[^>]*)?>[\s\S]*?<\/code>|<[^>]+>)/'
I have some custom replacements I want to do, but they can't happen in pre or code blocks. I can't do the replacements after the markdown has been done because it will replace them in code and pre blocks.
I assume this is a job for extensions, but I can't figure out how. Any advice?