Community
    • 登入

    HTML official elements not recognized by Notepad++

    已排程 已置頂 已鎖定 已移動 General Discussion
    htmlw3c
    5 貼文 4 Posters 5.9k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Ivan MillerI
      Ivan Miller
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • Claudia FrankC
        Claudia Frank @Ivan Miller
        最後由 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 條回覆 最後回覆 回覆 引用 2
        • PeterJonesP
          PeterJones
          最後由 編輯

          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 條回覆 最後回覆 回覆 引用 2
          • dailD
            dail
            最後由 編輯

            @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 條回覆 最後回覆 回覆 引用 1
            • Claudia FrankC
              Claudia Frank @PeterJones
              最後由 Claudia Frank 編輯

              @PeterJones

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

              Cheers
              Claudia

              1 條回覆 最後回覆 回覆 引用 0
              • 第一個貼文
                最後的貼文
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors