Community
    • Login

    UDL based on default HTML

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 346 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.
    • SEE-ICTS
      SEE-ICT
      last edited by

      I’m trying to add to the default HTML folding, but since, unlike, e.g., JavaScript, there are no provisions for adding user-defined keywords to the predefined ones, I’m not sure how to do that. Can anyone give me any guidance on this?

      Here’s what I’m attempting to achieve: I would simply like to add to the standard HTML folding, folding in these circumstances:

      {{#arbitrary text 1}}
      other arbitrary text not enclosed in double curly brackets}
      {{more arbitrary text enclosed in double curly brackets}}
      {{^arbitrary text 2}}
      still more arbitrary text {not enclosed in double curly brackets
      {{even more arbitrary text in double curly brackets}}
      {{/arbitrary text 2}}
      {{/arbitrary text 1}}

      The text opening the fold must be the same as that closing it except for the initial # or ^, which opens the fold, and /, which closes it. The text after the initial #, ^ or /, as the case may be, is arbitrary and may contain white space and symbols (including #, ^ and /, but not { or }). To trigger a fold, the initial #, ^ or / must be preceded by two left curly brackets. Two right curly brackets delimit the text that identifies the fold, i.e., in the example above, arbitrary text 1 and arbitrary text 2.

      Within the fold text is completely arbitrary except that initial {{ must be matched by closing }}.

      Thanks for any help that you can give.

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @SEE-ICT
        last edited by

        @see-ict

        I don’t think this can be achieved with the builtin or the udl lexer.
        The only possibility I see is to write a separate lexer for it.
        Just in case you want to go this way, you can find more information on this topic here.

        SEE-ICTS 1 Reply Last reply Reply Quote 2
        • SEE-ICTS
          SEE-ICT @Ekopalypse
          last edited by

          @ekopalypse Thanks for the quick reply. I’m not sure that the additional functionality would justify the work required to implement it. I’ll take a look and see. At least I’ll learn something about lexers!

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