1

I'm using Ace Editor, and I'm trying to figure out how to get it to live syntax check the HTML markup AND JavaScript code in the editor.

If I set "ace/mode/html" only HTML syntax is checked, so in the following code

<!DOCTYPE HTML>
<html>
    <head>
        <title>Test</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <script>
            alert('This is a syntax error'+);
        </script>
    </body>
</html>

the JS syntax error is ignored by the editor.

Is there a way to tell to Ace Editor to check both HTML and Javascript?

Thank you very much!

THIS IS NOT A DUPLICATE OF How do I enable Live Syntax Checking in the Ace Editor

The question above explains how to execute syntax check HTML and JS in 2 separate editors, while I'm asking how to check them in the same one.

1
  • @R My question is not a duplicate of stackoverflow.com/questions/21995198 The question above explains how to execute syntax check HTML and JS in 2 separate editors, while I'm asking how to check them in the same one. Commented Dec 18, 2016 at 10:33

1 Answer 1

1

You can use htmlhint, which has ace example running on thelanding page http://htmlhint.com/

Sign up to request clarification or add additional context in comments.

3 Comments

This does not solve my problem, it checks only html and it doesn't check javascript
check jshint and csslint checkboxes at the side of the page
Indeed, it seems that it is checking both html and javascript when I check the jshint box.

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.