Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Fussy Syntax Highlighting Problem

Fussy Syntax Highlighting Problem

Scheduled Pinned Locked Moved Site Bugs / Suggestions
help
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tony Richards
    wrote on last edited by
    #1

    Hi, I spotted a minor (very minor) issue with your syntax highlighting for <pre> blocks:

    var variable1=new string();
    var variable2 = new string();

    Notice that the first 'new' keyword is not the right colour, presumably because there is no space before the keyword. As I said, a very fussy thing to point out, and definitly not very important...

    L 1 Reply Last reply
    0
    • T Tony Richards

      Hi, I spotted a minor (very minor) issue with your syntax highlighting for <pre> blocks:

      var variable1=new string();
      var variable2 = new string();

      Notice that the first 'new' keyword is not the right colour, presumably because there is no space before the keyword. As I said, a very fussy thing to point out, and definitly not very important...

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      similar things happen with single quotes and double quotes. I suspect a Regex is used which ignores newlines. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      I only read formatted code with indentation, so please use PRE tags for code snippets.


      I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


      C 1 Reply Last reply
      0
      • L Luc Pattyn

        similar things happen with single quotes and double quotes. I suspect a Regex is used which ignores newlines. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read formatted code with indentation, so please use PRE tags for code snippets.


        I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


        C Offline
        C Offline
        Chris Maunder
        wrote on last edited by
        #3

        If we were ignoring newlines they wouldn't work at all. eg multiline comments. We'll check.

        cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

        L 1 Reply Last reply
        0
        • C Chris Maunder

          If we were ignoring newlines they wouldn't work at all. eg multiline comments. We'll check.

          cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          obviously, you can't completely ignore newlines, as they terminate single-line comments (// style). I apologize, almost nothing wrong with syntax coloring and quotes any more; I remember it being much worse. Right now the one mistake I see is VB should not escape within string literals. Here is a test without any lang="..":

          this is a "string"
          for a 'string' in some languages
          this could be a "for now an ' embedded single quote in a string" and for more text
          this could be a "for now an ' embedded single quote in a string" and for more text
          for a "for now an ' embedded single quote in a string" and // for more text
          this could be a "for now an ' embedded single quote in a string" /* and for more text */ here
          this could be a "for now an ' embedded single quote in a string" /* and for
          this could be a "string with an escaped double quote \" inside"
          wow */ going well
          this could be a "string with an escaped double quote \" inside"

          and now re repeat all the above once more:

          this is a "string"
          for a 'string' in some languages
          this could be a "for now an ' embedded single quote in a string" and for more text
          this could be a "for now an ' embedded single quote in a string" and for more text
          for a "for now an ' embedded single quote in a string" and // for more text
          this could be a "for now an ' embedded single quote in a string" /* and for more text */ here
          this could be a "for now an ' embedded single quote in a string" /* and for
          this could be a "string with an escaped double quote \" inside"
          wow */ going well
          this could be a "string with an escaped double quote \" inside"

          Here is a test using lang="cs":

          this is a "string"
          for a 'string' in some languages
          this could be a "for now an ' embedded single quote in a string" and for more text
          this could be a "for now an ' embedded single quote in a string" and for more text
          for a "for now an ' embedded single quote in a string" and // for more text
          this could be a "for now an ' embedded single quote in a string" /* and for more text */ here
          this could be a "for now an ' embedded single quote in a string" /* and for
          this could be a "string with an escaped double quote \" inside"
          wow */ going well
          this could be a "string with an escaped double quote \" inside"

          and now re repeat all the above once more:

          this is a "string"
          for a 'string' in some languages
          this could be a "for now an ' embedded single quote in a string" and for more text
          this could be a "for now an ' embedded single quote in a str

          C 1 Reply Last reply
          0
          • L Luc Pattyn

            obviously, you can't completely ignore newlines, as they terminate single-line comments (// style). I apologize, almost nothing wrong with syntax coloring and quotes any more; I remember it being much worse. Right now the one mistake I see is VB should not escape within string literals. Here is a test without any lang="..":

            this is a "string"
            for a 'string' in some languages
            this could be a "for now an ' embedded single quote in a string" and for more text
            this could be a "for now an ' embedded single quote in a string" and for more text
            for a "for now an ' embedded single quote in a string" and // for more text
            this could be a "for now an ' embedded single quote in a string" /* and for more text */ here
            this could be a "for now an ' embedded single quote in a string" /* and for
            this could be a "string with an escaped double quote \" inside"
            wow */ going well
            this could be a "string with an escaped double quote \" inside"

            and now re repeat all the above once more:

            this is a "string"
            for a 'string' in some languages
            this could be a "for now an ' embedded single quote in a string" and for more text
            this could be a "for now an ' embedded single quote in a string" and for more text
            for a "for now an ' embedded single quote in a string" and // for more text
            this could be a "for now an ' embedded single quote in a string" /* and for more text */ here
            this could be a "for now an ' embedded single quote in a string" /* and for
            this could be a "string with an escaped double quote \" inside"
            wow */ going well
            this could be a "string with an escaped double quote \" inside"

            Here is a test using lang="cs":

            this is a "string"
            for a 'string' in some languages
            this could be a "for now an ' embedded single quote in a string" and for more text
            this could be a "for now an ' embedded single quote in a string" and for more text
            for a "for now an ' embedded single quote in a string" and // for more text
            this could be a "for now an ' embedded single quote in a string" /* and for more text */ here
            this could be a "for now an ' embedded single quote in a string" /* and for
            this could be a "string with an escaped double quote \" inside"
            wow */ going well
            this could be a "string with an escaped double quote \" inside"

            and now re repeat all the above once more:

            this is a "string"
            for a 'string' in some languages
            this could be a "for now an ' embedded single quote in a string" and for more text
            this could be a "for now an ' embedded single quote in a str

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #5

            Thanks Luc - I've added this to our todo.

            cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

            L 1 Reply Last reply
            0
            • C Chris Maunder

              Thanks Luc - I've added this to our todo.

              cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              It's no biggy. Zero priority would be fine by me. I'd rather see you fix the HTMLtag+newline issue in the message editor (newline getting eaten). :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              I only read formatted code with indentation, so please use PRE tags for code snippets.


              I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups