Community
    • Login

    HTML official elements not recognized by Notepad++

    Scheduled Pinned Locked Moved General Discussion
    htmlw3c
    5 Posts 4 Posters 5.6k 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.
    • Ivan MillerI
      Ivan Miller
      last edited by

      I’m sorry that recognition (and syntax highlighting) does not work for some official HTML elements like <main> <math> <picture> <template> and <svg>.

      These 5 tags are present in the W3C standards.

      Is it possible to correct this please?
      Thank you.

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Ivan Miller
        last edited by Claudia Frank

        @Ivan-Miller

        are you using the latest version because 4 out of the 5 are highlighted.
        math is the one which is missing.

        Do you know that you can fix this yourself?
        For highlighting you need to edit the file langs.xml
        which is either under %APPDATA%\notepad++\ or under
        the installation directory (depends how you installed the npp)

        For recognition you need to edit the html api file which is located
        under the install_directory\plugins\APIs\html.xml.

        In both files, make sure you put the new content in the correct place,
        means take care about the sorting math needs to be placed between
        marquee and maxlength (langs.xml).

        If you feel this needs to be officially addressed open an issue at github.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 2
        • PeterJonesP
          PeterJones
          last edited by

          Interesting,

          I have NPP 7.2.2 (not the latest, but close), and it didn’t have any of the tags @Ivan-Miller listed as missing. When I looked at the install-directory langs.model.xml file, it did include those (except <math>).

          So apparently, updating NPP doesn’t automatically update the %APPDATA% file (understandable, since some people have customized it, and the updater was probably made to not clobber those) – but that means that just “using the latest version” isn’t always sufficient to get all the updates provided in that version.

          I copied the langs.model.xml to %APPDATA%\Notepad++\langs.xml, and that fixed the highlighting of those elements for me, so I hope they will for Ivan, as well.

          Claudia FrankC 1 Reply Last reply Reply Quote 2
          • dailD
            dail
            last edited by

            @PeterJones

            isn’t always sufficient to get all the updates provided in that version.

            You are correct. This has bugged me for a while. langs.model.xml is only used if langs.xml doesn’t exist. That’s why if a user reports their styling is incorrect it is usually a good idea to delete langs.xml (but custom user settings could get lost).

            See: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/1205

            1 Reply Last reply Reply Quote 1
            • Claudia FrankC
              Claudia Frank @PeterJones
              last edited by Claudia Frank

              @PeterJones

              you are right, this is one of npps mantras.
              Don’t change customized config files.
              Thx for clarification.

              Cheers
              Claudia

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