wooorm / refractor

Lightweight, robust, elegant virtual syntax highlighting using Prism
MIT License
722 stars 33 forks source link

Prism is running on page load #4

Closed tamagokun closed 6 years ago

tamagokun commented 6 years ago

when the page loads, it seems like Prism gets run across the entire page. Is there a way to work around this?

tamagokun commented 6 years ago

Seems like if it gets loaded in page, it will run "highlightAll" unless Prism.manual is set to true.

https://github.com/PrismJS/prism/blob/gh-pages/components/prism-core.js#L505-L522

wooorm commented 6 years ago

So, from what I’m reading, we must set window.Prism = {manual: true} to turn this off?

Would you be interested in a tested PR for this?

tamagokun commented 6 years ago

totally. PR coming up.