matcornic / hugo-theme-learn

Porting Grav Learn theme to Hugo
https://learn.netlify.com/en/
MIT License
1.61k stars 1.28k forks source link

search.js can lock up browser when parsing certain data #417

Open 0x91 opened 4 years ago

0x91 commented 4 years ago

Similar to #314.

I found that when the index includes a large amount of contiguous text, in our case it was a base64 encoded TLS certificate string, then the regex here can cause a lock up:

https://github.com/matcornic/hugo-theme-learn/blob/3efb32712c5cc77e644852d13ce3525780374b10/static/js/search.js#L74

I found this using both chrome and Firefox

noizbuster commented 4 years ago

Are you using baseUrl?