![]() | This proposal is part of "A Dozen Visions for Wikitext". Shortcuts: Versioning - Grunge - Markdown - HTML-only wikis - Extension tag fragments - Syntax uniformity - Colon replacement - Backticks - Syntax for Discussions - #media - #lang - #balance - Long arguments - Variable-length/structured arguments - Annotations - Visual Templates - Page Description Language - Native Script Editing - One Wiki |
This is a bonus proposal, not included in the Wikimania 2025 talk! Instead this is based on a proposal drawn up during the Wikimania 2019 hackathon. It sits on the edge of "syntax reforms included in Grunge", because although Grunge includes block list items, the proposed syntax in Grunge was very different.
From the parsing perspective, discussions on talk pages are a big list (the :
character used for replies technically introduces a HTML “definition list” item), and threads are separated by section headings. Signatures are entered with four tildes ~~~~
, and typically expand to your username, a link to your talk page, and the current day and time, localized appropriately for the current wiki, although this can be customized in user preferences.[1] This presents three main issues: first, it is difficult to reliably extract attribution from custom signatures and the signature date from the localized timestamp. Second, list item syntax is fragile and easily broken; identifying the boundaries of each individual comment in a thread is thus more difficult than it should be. Finally, individual list items don't have stable id attributes that can be used to link to them.[2]
To improve the reliability of signature parsing, we propose to introduce a new parser function {{#~}}
with three arguments: the user id, an ISO 8601 timestamp,[3] and an optional customized signature string. Currently when an edit is saved ~~~~
is expanded to:
[[User:Username|Username]] ([[User talk:Username|talk]]) 17:24, 16 August 2025 (UTC)
Instead we propose to expand it to:
{{#~:Username|2025-08-16T17:24}}
and this would render identically to before:
Note that the timestamp is still rendered in localized format appropriate for the user and wiki, but is stored in the wikitext in a format which is easily machine-parsable.
If the user has customized their signature, then {{#~}}
would render their current customized signature.[4] Some users, however, use their signature to track the passing of time and don't want to update old signatures. For users who have "always show latest signature" deselected in their user preferences, we use the third argument to track their current signature. ~~~~
expands to:
{{#~:Username|2025-08-16T17:24|[[User:Username|Username]] ([[User talk:Username|talk]]}}
or whatever their custom signature currently is, and {{#~}}
uses the third argument instead of their current customized signature. The custom signature doesn't override the localized time, and the user id is still easily parsed from wikitext as the first argument to {{#~}}
irrespective of user customizations.
Currently a comment which extends to multiple paragraphs in wikitext looks like this:
: This is the parent comment. {{#~:Alice|2025-08-01T01:23}}
:: This is a long reply. It goes on and on.
:: In fact it is still going.
:: Finally, Bob concludes. {{#~:Bob|2025-08-02T12:34}}
This syntax is fragile, and doesn't allow for many wikitext constructs inside the comment, like tables. Each "paragraph" is a separate list item in the HTML. We have to make guesses about the exact start of Bob's comment: does it really include all three paragraphs/list items, or were the first one or two lines a comment by some other user, who just forgot to sign their comment? We propose that each comment should be a single list item, using the following syntax for block list items:
: This is the parent comment. {{#~:Alice|2025-08-01T01:23}}
:: <<< This is a long reply. It goes on and on.
In fact it is still going.
Finally, Bob concludes. {{#~:Bob|2025-08-02T12:34}} >>>
This uses the <<< >>>
delimiters proposed in long arguments to templates, and can be extended with hash fragments as discussed in that proposal to allow arbitrary wikitext to be included in each comment without breaking the list item syntax. Some users may wish to include optional line prefixes as well so that replies maintain a consistent indentation level.
Taking inspiration from table attribute syntax, we can extend the above "long" list item syntax to accommodate optional attributes on the list item:
:: id=my-comment class=important <<< This is my comment! >>>
This allows associating specific permanent id
s to a certain comment. These could be generated by reply tool to be unique but user-friendly. Further, we could extend the same to "long" headings:
== id=my-heading <<< This is my heading >>> ==
There is a modest amount of lookahead needed past the attribute list to determine if a "long" delimiter <<<
is present.
Putting this all together, a discussion might look like this:
== Is this syntax okay? ==
I think it probably will be fine. {{#~:Alice|2019-08-17T10:45}}
: Will it, though? {{#~:Bob|2019-08-17T10:46}}
== id=rebuttal <<< Maybe we need a few extensions >>> ==
It’s possible we need to think this through more?
{{#~:Eve|2019-08-17T10:47}}
: id=denial <<< No, nothing’s wrong with it.
In fact, I love it! {{#~:Mallory|2019-08-17T10:48}} >>>
:: Agreed, everything is just fine. {{#~:Alice|2019-08-17T10:49|[[User:Alice|'''alice''']]}}
Next section: {{#media}}
~~~~
(phab:T230652).id
attributes for individual comments in a post-processing pass, and it has a relatively complicated and fragile signature parser which nonetheless practically speaking handles most signatures. DiscussionTools still limits the contents of comments using the reply tool due to the lack of block list item syntax.T
to separate the date and time.[[User:cscott/signature]]
. The normal dependency mechanisms can be used to update signatures, treating {{#~}}
as a transclusion where appropriate, and the standard tools can be used to protect or revert edits to the signature. There are currently restrictions on the wikitext allowed in a signature (it must be balanced, for example, and ~~~~
is not allowed) and those restrictions will be applied to the subpage as well.