There's an increasing need for standardisation of syntax for "end tags".
TWikiVariables are frequently used as delimiters for blocks of content - e.g. STARTINCLUDE....STOPINCLUDE, SECTION...ENDSECTION but there is no standardisation for the syntax of end tags, making it impossible to write a general parser for these kinds of constructs.
Some alternatives:
- Bastardised XML tags c.f.
<verbatim>...</verbatim>.
- + consistent with <verbatim>
- - not consistent with anything else
- - confusion with HTML tags
- - Personally I think this is really, really, really bad practice, and would like to deprecate <verbatim> in favour of %VERBATIM%
- %TAG%...%ENDTAG - Reserve the three characters
END at the start of a tag name to refer to a tag that is paired with a matching tag without the END
- + Consistent with SECTION...ENDSECTION
- + Simple, intention-revealing
- - Slight risk of conflict with real words e.g. ENDLESS, ENDEAVOUR, ENDIVE, ENDOMORPHIC
- %TAG%...%/TAG%
- + consistent with XML syntax
- - not very intention-revealing
- - not in current use
My personal preference is to standardise on 2.
--
CrawfordCurrie - 31 Oct 2005
Do you like underscores? END_VERBATIM would avoid conflict with END.* words.
--
MartinCleaver - 31 Oct 2005
Having the END at the ... end would avoid that problem:
- %VERBATIMEND%
- %TAGEND%
- %COLOREND%
just match on
"%[A-Z][A-Z]*END%"
Somehow the END at the end seems approrate. I don't know if the pun maps to other languages.
--
AntonAylward - 31 Oct 2005
CategoryTWikiSyntax