UDL based on default HTML
-
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.
-
-
@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!