Page MenuHomePhabricator

parser function to query the name of enclosing sections: {{#section-name:<section level>}}
Closed, ResolvedPublic

Description

Author: Bernhard.Fastenrath


Version: unspecified
Severity: enhancement

Details

Reference
bz9240

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:35 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz9240.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Kind of tricky to implement at present, due to the way we store sections. In particular, parser-
hook functions of any sort don't have access to the rendered section titles, due to the multipass
parser. Such a function would have to be treated specially somehow, like add some kind of dummy
unique tag that could be replaced in a later pass. (And, of course, recursion would probably
have to be special-cased, e.g., ==Foo{{sectionname}}bar== would probably need to be treated as
literal.)

Bernhard.Fastenrath wrote:

You gave the answer yourself. Make it the section name as present in the input,
with no translations applied.
You could, of course, offer another parser function capable to apply the
required translations ;-)
Nicely bizarre.

  • This bug has been marked as a duplicate of bug 1605 ***