Community
    • Login

    Mildly curious about json syntax highlighting

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 59 Views
    Loading More Posts
    • 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.
    • Alan KilbornA
      Alan Kilborn
      last edited by

      I have some data in .json file, that as far as I can tell is valid (i.e., processes for me with Python using the json library).

      Anyway, Notepad++ seems to syntax highlight it wrongly in certain cases – I’m wondering if others have such experience…

      Here’s an example:

      {
          "hello2" : {
              "dd - xxxxxxxxxxxxxxxx (xxx xxxxx xxxxx xxx) [xxxx xxxxxxxx xxxxx, xxxxxxxx, xxxxxxxx, xxx xxxx].xxx" : "testing"
          },
          "hello3" : {
              "dd - xxxxxxxxxxxxxxxx (xxx xxxxx xxxxx xxx) [xxxx A xxxxxxxx xxxxx, xxxxxxxx, xxxxxxxx, xxx xxxx].xxx" : "testing"
          }
      }
      

      When I put this into a Notepad++ (8.8.3) tab that has its language set to “JSON file”, it looks like this for me:

      d1ec63db-2689-4f90-9145-d020fa0fee81-image.png

      I would expect that line 6 is colored like line 3, but the addition of the space and the A in line 6 causes the coloring to change.

      1 Reply Last reply Reply Quote 1
      • rdipardoR
        rdipardo
        last edited by

        There’s a hard-coded limit of 100 characters for property names; the property inside “hello3” has 101. It’s a known issue.

        1 Reply Last reply Reply Quote 4
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors