Page MenuHomePhabricator

Tag hook: recursiveTagParse() - TOC not loaded
Closed, DuplicatePublic

Description

<foo>
== Heading 1 ==
Text

== Heading 2 ==
Text

== Heading 3 ==
Text
</foo>

This creates no TOC.

<foo>
__TOC__
...

This forces the TOC, but is a lame workaround.

__TOC__
== Heading 1 ==

<foo>
__TOC__
== Heading 2 ==
</foo>

This creates 2 TOCs so it clearly is bug that needs a fix.

Support desk discussion: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Tag_hook:_recursiveTagParse%28%29_-_TOC_not_loaded


Version: unspecified
Severity: normal

Details

Reference
bz35382

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:20 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz35382.
bzimport added a subscriber: Unknown Object (MLST).

Same for ref-tags inside tags:

<foo>
Text text.<ref name="bar" />
</foo>

Thuis returns a UNIQ error.

Raising importance level to "normal". It's not a minro issue imo.

(In reply to comment #1)

Raising importance level to "normal". It's not a minro issue imo.

How often is this problem seen?

(In reply to comment #1)

Same for ref-tags inside tags:

<foo>
Text text.<ref name="bar" />
</foo>

You're sure that's true on current mediawiki? There was a very similar bug fixed in 1.18.

How often is this problem seen?

I would put it at rarely. Very few extensions put headers inside of tag hooks that I am aware of.

Wiki at work. 1.18.0 iirc.

It doesn't matter how often it is seen imo. A bug is a bug and needs a fix.

Bawolff, can you point me to the recent fix?

(In reply to comment #4)

Wiki at work. 1.18.0 iirc.

It doesn't matter how often it is seen imo. A bug is a bug and needs a fix.

Well yes, but some bugs need to be fixed more than others ;)

Note: Just to clarify, by rarely I mean its relatively rare that people make tag extensions that would have the TOC or headers inside the tag. The actual bug appears everytime someone does such a thing.

Bawolff, can you point me to the recent fix?

r99062. It should be included in 1.18.1 (and 1.18.2). It was not included in 1.18.0

1.18.0 here and r99062 didn't fix it.

In LocalSettings.php:

$wgHooks['ParserFirstCallInit'][] = 'efMoreMarkup';
function efMoreMarkup( &$parser ) {

 $parser->setHook( 'gruen', 'efGruenHook' );
return true;

}
function efGreyHook( $input , $args , $parser ) {
$input = $parser-> recursiveTagParse( $input );

return '<span class="grey">' . $input . '</span>';

}