Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial cleanup #54

Merged
merged 3 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 97 additions & 46 deletions common/html/bidi-example-table.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,98 @@
<section id="app-bidi-examples" class="appendix informative">
<h2>Examples for bidirectional texts</h2>

<p>This section illustrates how Unicode formatting characters can be applied to bidirectional strings, where necessary, in order to help a consumer produce the expected display. In cases where the first-strong heuristics would produce the wrong result, if the string is created with a prepended formatting character, the first-strong heuristics will produce the correct base direction for the string as a whole.</p>

<p>A right-to-left string that begins with a Latin script character should have U+200F RIGHT-TO-LEFT MARK prepended.</p>

<table>
<tr>
<td>Character order in memory:&nbsp;</td>
<td><code><bdo dir="ltr">HTML היא שפת סימון.</bdo></code></td>
</tr>
<tr>
<td>Gives incorrect display:&nbsp;</td>
<td dir="ltr">HTML היא שפת סימון.</td>
</tr>
<tr>
<td>Source code with formatting character:&nbsp;</td>
<td><code>"<bdo dir="ltr">\u200FHTML היא שפת סימון.</bdo>"</code></td>
</tr>
<tr>
<td>Gives expected display:&nbsp;</td>
<td dir="rtl">HTML היא שפת סימון.</td>
</tr>
</table>

<p>A left-to-right string that begins with a Arabic script character should have U+200E LEFT-TO-RIGHT MARK prepended.</p>

<table>
<tr>
<td>Character order in memory:&nbsp;</td>
<td><code><bdo dir="ltr">'سلام' is hello in Persian.</bdo></code></td>
</tr>
<tr>
<td>Gives incorrect display:&nbsp;</td>
<td dir="rtl">'سلام' is hello in Persian.</td>
</tr>
<tr>
<td>Source code with formatting character:&nbsp;</td>
<td><code>"<bdo dir="ltr">\u200E'سلام' is hello in Persian.</bdo>"</code></td>
</tr>
<tr>
<td>Gives expected display:&nbsp;</td>
<td dir="ltr">'سلام' is hello in Persian.</td>
</tr>
</table>
<section id="app-bidi" class="appendix">
<h2>Bidirectional Texts</h2>

<section id="app-bidi-directionality">
<h3>Item-Specific Directionality in JSON-LD</h3>

<p>Setting the direction for a natural text value is currently not possible in JSON-LD&#160;[[json-ld]]. In
order to correctly handle manifests entries containing right-to-left or bidirectional text, user agents
SHOULD identify the base direction of any given natural language value by scanning the text for the first
strong directional character.</p>

<p>In situations where the first-strong heuristics will produce the wrong result (e.g., a string in the Arabic
or Hebrew script that begins with a Latin acronym), authors can prepend a Unicode formatting character (one
of U+200E LEFT-TO-RIGHT MARK or U+200F RIGHT-TO-LEFT MARK) to the string. This would then produce the
necessary base direction when the heuristics are applied. (See <a href="#app-bidi-examples"/>.)</p>

<p>Once the base direction has been identified, user agents MUST determine the appropriate rendering and display
of natural language values according to the Unicode Bidirectional Algorithm&#160;[[!bidi]]. This could
require wrapping additional markup or Unicode formatting characters around the string prior to display, in
order to apply the base direction.</p>

<p class="note">If authors intend to use a manifest, or a manifest template, both as embedded manifest and as a
separate resource, they are strongly encouraged to set these properties explicitly to avoid interference of
the containing <code>script</code> element in case of embedding.</p>

<aside class="note">
<p>Future versions of this specification could extend the ability of manifests to identify item-specific
directionality if the JSON-LD and schema.org communities introduce such a feature.</p>

<p>For more information about localized strings on the Web, refer to [[string-meta]].</p>
</aside>
</section>

<section id="app-bidi-examples" class="informative">
<h3>Bidirectional Text Examples</h3>

<p>This section illustrates how Unicode formatting characters can be applied to bidirectional strings, where
necessary, in order to help a consumer produce the expected display. In cases where the first-strong
heuristics would produce the wrong result, if the string is created with a prepended formatting character,
the first-strong heuristics will produce the correct base direction for the string as a whole.</p>

<p>A right-to-left string that begins with a Latin script character should have U+200F RIGHT-TO-LEFT MARK
prepended.</p>

<table>
<tr>
<td>Character order in memory:&nbsp;</td>
<td>
<code>
<bdo dir="ltr">HTML היא שפת סימון.</bdo>
</code>
</td>
</tr>
<tr>
<td>Gives incorrect display:&nbsp;</td>
<td dir="ltr">HTML היא שפת סימון.</td>
</tr>
<tr>
<td>Source code with formatting character:&nbsp;</td>
<td>
<code>"<bdo dir="ltr">\u200FHTML היא שפת סימון.</bdo>"</code>
</td>
</tr>
<tr>
<td>Gives expected display:&nbsp;</td>
<td dir="rtl">HTML היא שפת סימון.</td>
</tr>
</table>

<p>A left-to-right string that begins with a Arabic script character should have U+200E LEFT-TO-RIGHT MARK
prepended.</p>

<table>
<tr>
<td>Character order in memory:&nbsp;</td>
<td>
<code>
<bdo dir="ltr">'سلام' is hello in Persian.</bdo>
</code>
</td>
</tr>
<tr>
<td>Gives incorrect display:&nbsp;</td>
<td dir="rtl">'سلام' is hello in Persian.</td>
</tr>
<tr>
<td>Source code with formatting character:&nbsp;</td>
<td>
<code>"<bdo dir="ltr">\u200E'سلام' is hello in Persian.</bdo>"</code>
</td>
</tr>
<tr>
<td>Gives expected display:&nbsp;</td>
<td dir="ltr">'سلام' is hello in Persian.</td>
</tr>
</table>
</section>
</section>
Loading