Looks like it doesn't deal with missing semicolons well. It indents
fine for me if I add the missing ; to the end of
ctx.fillRect(0,0,300,150).

I should note I'm using janus (https://github.com/carlhuda/janus) but
I don't believe it adds any additional syntax handlers for HTML files.

--
Dan DeFelippi
http://driverdan.com
On Feb 19, 10:25 am, Peng Yu <[email protected]> wrote:
> Hi,
>
> Although this vim question is not directly related with node, it is
> relevant.
>
> http://groups.google.com/group/nodejs/browse_thread/thread/c5fe809d3c...
>
> The above thread mentioned some vim plugins.
>
> I currently usehttps://github.com/othree/html5.vim/blob/master/indent/html.vim
> for indenting html files. But it can not correctly indent embedded
> javascript code.
>
> Does anybody know any plugin that can correctly indent javascript and
> css code in html file?
>
> <!DOCTYPE html>
> <html>
>   <body>
>
>     <canvas id="myCanvas" width="300" height="150" style="border:1px
> solid #d3d3d3;">
>       your browser does not support the canvas tag </canvas>
>
>     <script type="text/javascript">
>
>       var c=document.getElementById("myCanvas");
>       var ctx=c.getContext("2d");
>       ctx.rect(10,15,200,75);
>       ctx.clip();
>       ctx.fillStyle="lightblue";
> ctx.fillRect(0,0,300,150)
>   ctx.fillStyle="red";
>   ctx.font="30px Arial";
>   ctx.fillText("Hello world", 10,30);
>
> </script>
>
> </body>
> </html>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to