Template:Bdi/doc: Difference between revisions

(Corr.)
 
(5 intermediate revisions by the same user not shown)
Line 36: Line 36:
The {{tag|bdi|o}} tag ''derives'' the direction of the text it encloses from the text itself. You don't include any directional information. The {{tag|bdo|o}} tag, however, ''forces'' the text it encloses to flow in a certain direction, specified through the attribute <code>dir{{=}}</code>.
The {{tag|bdi|o}} tag ''derives'' the direction of the text it encloses from the text itself. You don't include any directional information. The {{tag|bdo|o}} tag, however, ''forces'' the text it encloses to flow in a certain direction, specified through the attribute <code>dir{{=}}</code>.


Because of that, {{tl|bdo}} shouldn't be used in cases where the direction of the inserted text is unknown, but is a good alternative if {{tl|bdi}} fails to derive the direction.
Because of that, {{tl|bdo}} shouldn't be used in cases where the direction of the inserted text is unknown, but it is a good alternative if {{tl|bdi}} should fail to derive the direction.


====&lt;bdi&gt;====
====&lt;bdi&gt;====
{| border="0"
The {{tag|bdi|o}} tag is used in the same way, regardless of the text direction of the inserted string.
| {{tlc|bdi|From left to right}} || &rarr; || {{bdi|From left to right}}
{| class="wikitable" style="background-color: white;"
|-
|-
| {{tlc|bdi|من اليمين إلى اليسار}} || &rarr; || {{bdi|من اليمين إلى اليسار}}
! Case !! What you type !! What you see !! Comments
|-
| rowspan="2" | {{tag|bdi|o}} adapts to <br>the text direction of <br>the enclosed string || {{tlc|bdi|من اليمين إلى اليسار}} || {{bdi|من اليمين إلى اليسار}} || rowspan="2" | Works for both <tt>rtl</tt> and <tt>ltr</tt> input
|-
| {{tlc|bdi|From left to right}} || {{bdi|From left to right}}
|}
|}


Line 48: Line 52:
The {{tag|bdo|o}} tag may make the text virtually unreadable, if used incorrectly. Mind the <code>dir{{=}}</code>.
The {{tag|bdo|o}} tag may make the text virtually unreadable, if used incorrectly. Mind the <code>dir{{=}}</code>.


;<big>Incorrect</big>
;<big>Correct</big>
{| border="0"
{| class="wikitable" style="background-color: white;"
| {{tlc|bdo|From left to right}} || &rarr; || {{bdo|From left to right}}
|-
! Case !! What you type !! What you see !! Comments
|-
| rowspan="2" | {{tag|bdo|o}} has a preset <br>directional output || {{tlc|bdo|من اليمين إلى اليسار}} || {{bdo|من اليمين إلى اليسار}} || The default direction is <tt>rtl</tt>
|-
|-
| {{tlc|bdo|dir{{=}}ltr|من اليمين إلى اليسار}} || &rarr; || {{bdo|dir=ltr|من اليمين إلى اليسار}}
| {{tlc|bdo|dir{{=}}ltr|From left to right}} || {{bdo|dir=ltr|From left to right}} || <tt>ltr</tt> must be explicitly specified
|}
|}


;<big>Correct</big>
;<big>Incorrect</big>
{| border="0"
{| class="wikitable" style="background-color: white;"
| {{tlc|bdo|dir{{=}}ltr|From left to right}} || &rarr; || {{bdo|dir=ltr|From left to right}}
|-
! Case !! What you type !! What you see !! Comments
|-
| rowspan="2" | Wrong value for <br>the {{code|dir}} attribute || {{tlc|bdo|dir{{=}}ltr|من اليمين إلى اليسار}} || {{bdo|dir=ltr|من اليمين إلى اليسار}} || rowspan="2" | The text is displayed backwards ({{tag|bdo|o}} forces the direction)
|-
|-
| {{tlc|bdo|من اليمين إلى اليسار}} || &rarr; || {{bdo|من اليمين إلى اليسار}}
| {{tlc|bdo|From left to right}} || {{bdo|From left to right}}
|}
|}


==See also==
==See also==
* {{tl|bdo}}: inserts {{tag|bdo|o}} tags to allow for inline changes in text direction.
* {{tl|bdo}}: inserts {{tag|bdo|o}} tags, forcing inline changes in text direction.


* {{tl|abbr}}: inserts {{tag|abbr|o}} tags to include a tooltip explanation of an abbreviation.
* {{tl|abbr}}: inserts {{tag|abbr|o}} tags to include a tooltip explanation of an abbreviation.
* {{tl|code}}: inserts {{tag|code|o}} tags.
* {{tl|code}}: inserts {{tag|code|o}} tags.
* {{tl|mark}}: inserts {{tag|mark|o}} tags.
* {{tl|mark}}: inserts {{tag|mark|o}} tags, highlighting the enclosed text.
* {{tl|samp}}: inserts {{tag|samp|o}} tags.
* {{tl|samp}}: inserts {{tag|samp|o}} tags.
* {{tl|var}}: inserts {{tag|var|o}} tags.
* {{tl|var}}: inserts {{tag|var|o}} tags.
3,860

edits