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

syntax highlighting perl with large multiline html strings

Expand Messages
  • Fred Malone
    Hi all, I apologize if this has been asked before. I do a lot of programming in perl as cgi files and such. Many of the scripts I work on do a lot of html
    Message 1 of 2 , May 31, 2011
    • 0 Attachment
      Hi all,

      I apologize if this has been asked before.  I do a lot of programming in perl as cgi files and such.  Many of the scripts I work on do a lot of html printing.  Frequently there are multi-line html sections such as this:
      print <<HTML;
      <html>
      <body>
      ...
      </body>
      </html>
      HTML

      The problem is that vim will mixup (turn off/on) the syntax highlighting within the string if I start includes quotes such as in javascript or even just class='someclass'.  Everything between the <<HTML and the last HTML should be considered a string.  Vim in both the terminal and gVim will stop treating the whole block as a string.  Is this a known issue?  Is there a way to prevent this from happening or to quickly reset it?

      Thanks.

      --
      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
    • Shlomi Fish
      Hi Fred, just a tangential note. ... You should always specify the type of quotes of the here-doc explicitly:
      Message 2 of 2 , Jun 1, 2011
      • 0 Attachment
        Hi Fred,

        just a tangential note.

        On Tuesday 31 May 2011 23:02:58 Fred Malone wrote:
        > Hi all,
        >
        > I apologize if this has been asked before. I do a lot of programming in
        > perl as cgi files and such. Many of the scripts I work on do a lot of html
        > printing. Frequently there are multi-line html sections such as this:
        > print <<HTML;

        You should always specify the type of quotes of the here-doc explicitly:
        <<"HTML" or <<'HTML' because people don't always get it right. For more
        information see:

        http://perl-begin.org/tutorials/bad-elements/#string-notation

        And:

        http://perl-begin.org/books/advanced/#pbp

        Regards,

        Shlomi Fish

        --
        -----------------------------------------------------------------
        Shlomi Fish http://www.shlomifish.org/
        "Star Trek: We, the Living Dead" - http://shlom.in/st-wtld

        Yesterday I asked one of my students if she knew what an encyclopedia is, and
        she said: "Is it something like Wikipedia?".
        -- http://twitter.com/alisonclement/status/8421314259

        Please reply to list if it's a mailing list post - http://shlom.in/reply .

        --
        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
      Your message has been successfully submitted and would be delivered to recipients shortly.