Last modified: 2010-06-10 23:19:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25894, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23894 - Template reference can't be indented, indent in template breaks numbering
Template reference can't be indented, indent in template breaks numbering
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-10 22:06 UTC by Eric Armstrong
Modified: 2010-06-10 23:19 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Eric Armstrong 2010-06-10 22:06:32 UTC
Sample Template T
==================
{| style="width: 85%; margin-left: border-collapse: collapse; background: #FBFBFB; border: 1px solid #aaa; border-left: 10px solid #ffb400;"
|
'''Note:''' {{{1}}}
|}
<noinclude>
----
This template is used for a highlighted note.
;Usage: 
:<tt><nowiki>{{Tip|1}}</nowiki>
::<nowiki>{{1}}</nowiki> = Text of the tip</tt>
</noinclude>

The goal is to transclude that template into a numbered list, to produce:

  1. Item A
   
     Text

  2. Item B


A. Template with no indent
==========================
If T does not contain indentation, an attempt to indent a reference to it fails to indent properly, and breaks list numbering.

So
--
#Item A
#:{{T| Text}}
#Item B

Produces:
--------
  1. Item A

text

  1. Item B 


B. Template includes list indentation (#:{| style=...)
======================================================
If the template includes indentation using "#:", it simply breaks. 

(That would be brittle in any case, as it would require different versions of the template for different indents, with each list type.)


C. Template includes double indent (::{| style=...)
===================================================
If the template includes indentation using "::", the transclusion appears in the correct place, but list numbering is broken.

So
--
#Item A
#:{{T| Text}}
#Item B

Produces
--------
  1. Item A
     
     Text

  1. Item B
Comment 1 Eric Armstrong 2010-06-10 22:09:06 UTC
Note:
The template may well be breaking list numbering for other reasons. But the sample is the type that is needed, with the recommended usage information.
Comment 2 Platonides 2010-06-10 22:13:04 UTC
Tables are block elements, no wonder they don't work inside lists.

If you intend to use notes inline, you could make it a span, ie. <span style="width: 85%; margin-left: border-collapse: collapse; background: #FBFBFB; border: 1px solid #aaa; border-left: 10px solid #ffb400;"> '''Note:''' {{{1}}} </span>

Then you will be able to #: indent it.
Comment 3 Eric Armstrong 2010-06-10 23:18:05 UTC
Very nice! Many thanks for the helpful info. I inherited a local Wiki instance, and followed an anti-pattern. I appreciate the help! (Much nicer than just tossing the non-bug.)
:__)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links