This page is a documentation on troubleshooting of issues often encountered when setting up WdsTooltips.
Toggle Creating Line Breaks
By default, MediaWiki wraps plain text blocks inside paragraphs (<p>). Since <p> is a block-level element which only allows phrasing elements inside, it gets cut off/closed as soon as meeting a <div> element, preventing the tooltip toggle from being used in-line with other text. This behaviour can be worked around by manually wrapping the containing text block with <span> or <div> (or any of the relevant HTML tags) that can avoid the auto-generation of <p> elements.
To best comply with accessibility and semantics, the format specified below is recommended.
- Wikitext
<div role="paragraph">This is an {{WdsTooltips|inline-level|content}} tooltip.</div>
- Output
- This is antooltip.inline-levelcontent
Using Line-break Wikitext
*, #, ;, :, {| |}) might not be straightforward. This can be worked around by inserting a whitespace character <nowiki/> at the beginning.- Wikitext
{{WdsTooltips |A list |<nowiki/> # ListItem1 # ListItem2 # ListItem3 |class2 = wds-is-left-aligned }}
- Output
- A list
- ListItem1
- ListItem2
- ListItem3
Passing Named Parameters
Depending on the complexity of markup, passing parameters as named (|2 = or |content =) might also be necessary for the parser to properly understand the template call.
- Wikitext
{{WdsTooltips |toggle = A table |content = <nowiki/> {{{!}} class="wikitable" ! Header1 !! Header2 {{!}}- {{!}} Content1 {{!!}} Content2 {{!}}} |class2 = wds-is-left-aligned }}
- Output
- A table
Header1 Header2 Content1 Content2