highlightjs / highlightjs-terraform

terraform language
MIT License
7 stars 10 forks source link

Please make it work while editing the content #10

Open kopyl opened 2 years ago

kopyl commented 2 years ago

It's not currently possible to highlight the text on the fly.

If I enter this text into contenteditable field, then run this code:

hljs.registerLanguage('terraform', window.hljsDefineTerraform);
hljs.highlightAll();

I get this result: https://i.imgur.com/pYe2l91.png

kopyl commented 2 years ago

The HTML becomes this after "highlighting":

https://i.imgur.com/Q6MQL30.jpg

joshgoebel commented 2 years ago

Related: The duplicate issue opened against the main repo has been closed with wontfix. https://github.com/highlightjs/highlight.js/issues/3583