Giter VIP home page Giter VIP logo

Comments (4)

ankhers avatar ankhers commented on July 28, 2024

write a simple javascript file in js2-mode, something along the lines of

var total = 0;
total += 5
document.write(total);

Does that still give you bad highlighting?
I don't seem to have any issues when I changed my config to use js2-mode.

I believe the red text means that you have a syntax issue.

from multi-web-mode.

slinkp avatar slinkp commented on July 28, 2024

js2-mode works fine on the same script if i save it to a separate .js file.

If I take your example and wrap it in script tags:
<script type="text/javascript">
var total = 0;
total += 5
document.write(total);
</script>

... the closing tag is highlighted as a syntax error. It looks to me like js2-mode when run under multi-web mode is operating on the whole buffer. I don't know whether that's an obstacle in js2-mode itself, or what.

from multi-web-mode.

ankhers avatar ankhers commented on July 28, 2024

my guess would be that it is an issue with js2-mode. When I am mixing with an HTML file, I get something a little bit different than what you're describing. I just get no syntax highlighting while in the javascript chunk. I suggest either trying to find the issues and fixing them, or just stick with js-mode.

from multi-web-mode.

slinkp avatar slinkp commented on July 28, 2024

Sounds like that to me too. Was just hoping you had a clue how to fix it, as I am not really capable in elisp. I'll stick with js-mode. Thanks!

from multi-web-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.