Right now, HTML escaping is implemented like this but there are faster methods out there. This can speed up highlighting quite a bit. I.e. Prism is about 13% faster in total with the faster escaping but Highlight.JS should make its own performance tests.
I also want to point out that this is very much a tradeoff: execution speed vs bundle size.
Right now, HTML escaping is implemented like this but there are faster methods out there. This can speed up highlighting quite a bit. I.e. Prism is about 13% faster in total with the faster escaping but Highlight.JS should make its own performance tests.
I also want to point out that this is very much a tradeoff: execution speed vs bundle size.