Template:Wbr/doc: Difference between revisions

[checked revision][checked revision]
Content deleted Content added
Created page with "{{Documentation subpage}} {{Commons Import}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --..."
 
m Text replacement - "[[HTML" to "[[Wikipedia:HTML"
 
(One intermediate revision by the same user not shown)
Line 8:
to carefully control line-breaking where this is important.
 
This template can safely be [[Wikipedia:WP:SUBST|substituted]], though there is no particular reason to do so. For breaking up long words, use {{tlx|Soft hyphen}} instead.
 
==Usage==
Line 17:
 
===Controlling line-breaking in infoboxes ===<!--This section name is linked to from other template documentation.-->
This template can be used to cause an indentation after a linebreak, in [[Template:Plainlist|unbulleted lists]] inside [[Wikipedia:WP:Infobox|infoboxes]] and in [[Wikipedia:WP:Table|tables]] with constrained cell widths, by using <code><nowiki>{{wbr}}&amp;nbsp;</nowiki></code> between words in an entry, so that when they wrap they are not mistaken for separate entries. See example infobox to the side.
 
Example infobox (rendered to the side of the example code):
Line 49:
 
==Technical details==
This template encapsulates the code <code><nowiki><wbr />&#8203;</nowiki></code>, i.e. the HTML5 [[Wikipedia:HTML element#wbr|line break opportunity element]] followed by the HTML character entity for the {{Unichar|200B|ZERO WIDTH SPACE}} character. This approach is superior to using either one or the other in isolation, for increased browser support. The {{tag|wbr|s}} element is compatible with all browsers except [[Internet Explorer]] inclusive of and {{em|since}} version 7 ({{as of|lc=y|2015|09}}). Meanwhile, the ZWS character is compatible with all browsers except Internet Explorer {{em|earlier than}} (but not inclusive of) version 7. Thus, between the two approaches, the dual use of which has no ill effects, this template works in all browsers still likely to be in use, including Internet Explorer regardless of version.
 
<includeonly>{{Sandbox other||