2

I was curious if there was a way to get highlighting/indentation for any JavaScript that's inside of HTML5 tags? I don't frequently use JavaScript but for a class I'm in we're working with it. I assume it would be a matter of creating a JavaScript minor-mode and then hooking that into the HTML5 mode?

1 Answer 1

2

There's a major mode that can highlight nested languages for web along with server-side scripting languages like PHP and template languages. It's better than html-mode for HTML editing as well, since it understands indentation better and avoids doing silly things like indenting contents of <pre> tags.

It's called web-mode.

Here's a link to it's page, and here's the repo with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.