Loading ...
Sorry, an error occurred while loading the content.
 

Re: Problem with syntax/html.vim

Expand Messages
  • glts
    Gary, ... Double dash isn t allowed in XML comments. I think the highlighting is correct as it is. -- -- You received this message from the vim_use maillist.
    Message 1 of 3 , May 17, 2013
      Gary,

      On Friday, May 17, 2013 8:32:36 AM UTC+2, Gary Johnson wrote:
      > The highlighting is correct through the '--', but they incorrectly
      > terminate the comment region. The following '"/' are highlighted as
      > an error, as are '[endif]', and the </head> and </html> tags are
      > highlighted as comments.
      >
      > The problem seems to be this line in $VIMRUNTIME/syntax/html.vim
      > (dated 2012 Oct 05),
      >
      > syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
      >
      > which doesn't account for the possibility of '--' being anywhere
      > within a string.
      >
      > I don't know enough about syntax highlighting to know how to fix it,
      > though, and I would rather help the author with a solution than just
      > point out the problem, so I thought I'd ask here if anyone knew of a
      > solution. (I have Bcc'd the author.)

      Double dash isn't allowed in XML comments. I think the highlighting is
      correct as it is.

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gary Johnson
      ... Thank you. Your answer prompted me to do a little research which confirmed it. http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4
      Message 2 of 3 , May 17, 2013
        On 2013-05-17, glts wrote:
        > Gary,
        >
        > On Friday, May 17, 2013 8:32:36 AM UTC+2, Gary Johnson wrote:
        > > The highlighting is correct through the '--', but they incorrectly
        > > terminate the comment region. The following '"/' are highlighted as
        > > an error, as are '[endif]', and the </head> and </html> tags are
        > > highlighted as comments.
        > >
        > > The problem seems to be this line in $VIMRUNTIME/syntax/html.vim
        > > (dated 2012 Oct 05),
        > >
        > > syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
        > >
        > > which doesn't account for the possibility of '--' being anywhere
        > > within a string.
        > >
        > > I don't know enough about syntax highlighting to know how to fix it,
        > > though, and I would rather help the author with a solution than just
        > > point out the problem, so I thought I'd ask here if anyone knew of a
        > > solution. (I have Bcc'd the author.)
        >
        > Double dash isn't allowed in XML comments. I think the highlighting is
        > correct as it is.

        Thank you. Your answer prompted me to do a little research which
        confirmed it.

        http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4
        http://stackoverflow.com/questions/442786/are-nested-html-comments-possible

        So, Outlook generates invalid HTML. What a surprise.

        I have a workaround, so I'll use that when syntax highlighting
        Outlook messages.

        Regards,
        Gary

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.