Page MenuHomePhabricator

Give <noinclude> and <onlyinclude> sections a CSS class when viewing/editing the containing page
Closed, DeclinedPublic


Would it be possible to arrange that <noinclude> sections be displayed with a CSS class
to allow them to be made visible?

This would make it easier to confirm which parts of a template, for example, would NOT
be transcluded when editing.

Version: unspecified
Severity: enhancement



Event Timeline

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

robchur wrote:

This would be a poor idea. The purpose of a <noinclude> tag is to state text
which will not be retained when a template is included. This is desired to be
even for all users, including those with browsers without CSS support, and those
using screen readers. wrote:

@ Rob Church:

This would only be significant when viewing the template (or any page which has
the <noinclude> tag in it while viewing that page directly and not via
transclusion). Just wrapping <noinclude>'d content in a span tag with it's own
CSS class so it can be overridden should satisfy this report.

robchur wrote:

You need to be careful to be specific in future, then; this report read totally
differently to what you appear to actually be requesting.

In the same way, could those areas tagged with <onlyinclude> also be given similar

For the avoidance of doubt, this would only be when viewing or editing the page
containing those sections, to make it quite clear which areas of the current page
will be included or not if it were to be transcluded somewhere. wrote:

What should the value of {{#ifeq: <noinclude>Foo</noinclude> | Foo | true | false }} be? At which point in the parse process should these spans be added?

I could imagine problems with things like:
<noinclude> <span class="foo"></noinclude><includeonly><span class="bar"></includeonly>Some content </span>

Or even worse:

<span <noinclude> class="foo"</noinclude> <includeonly> class="bar" </includeonly> >Some content </span>

ayg wrote:

This is totally impractical; <noinclude> et al. can enclose absolutely anything, including stuff that produces only wikitext markup. Forget about the above, try:


It's extremely unlikely you'd be able to do this sanely.