[go: up one dir, main page]

Page MenuHomePhabricator

Support an #open-tag and #close-tag parser function to allow for generation of "unbalanced" HTML and pseudo tags in templates
Open, Needs TriagePublic

Description

This is an enhancement or feature request.

"What is the limitation or missing functionality?"

Currently there is a parser function documented here - https://www.mediawiki.org/wiki/Help:Magic_words#Parser_functions

called #tag which generates a balanced pair of tags for HTML or pseudo tags.

However it's not currently possible to split a #tag function, for situation when only one half of a pair of tags is needed. Wikisource uses a number of templates which are currently directly coded as /s /e versions containing the start or end tags respectively.

"What is the desired functionality?"

Implement an #open-tag and #close-tag function to generate the start of or end of a tag pair respectively...

"Concerns"

  • Do any pseudo tags implement attribute in their closing tag?
  • Some pseudo tags are in effect self closing like <section> tags used for Labelled Section Transclusion, without intervening content.

Event Timeline

It may be related to the former.. but I couldn't necessarily realte that ticket directly to this one...

Aklapper renamed this task from Support an #open-tag and #close-tag parser function to allow for generation of "unbalanced" HTML and pusedo tags in templates... to Support an #open-tag and #close-tag parser function to allow for generation of "unbalanced" HTML and pseudo tags in templates.Mar 2 2018, 7:52 AM

Wikisource uses a number of templates which are currently directly coded as /s /e versions containing the start or end tags respectively.

Any example link to share?

Wikisource uses a number of templates which are currently directly coded as /s /e versions containing the start or end tags respectively.

Any example link to share?

I think I can give an example with a template I am trying to set up on fr.wikisource : https://fr.wikisource.org/wiki/User:Seudo/Code

This template is a wrapper around <syntaxhighlight> that uses {{#tag: (the idea is to make it easier to use, providing e.g. a default language for use on help and discussion pages).

This template does not work when its contents includes wiki template calls like {{...}}. Therefore I thought about providing a pair of start and end templates, but (unless I'm wrong) I need #open-tag and #close-tag parser functions to make it function properly.