Skip to content

Commit 378393f

Browse files
authored
Editorial: ensure various bits link properly
1 parent e43b030 commit 378393f

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

encoding.bs

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Markup Shorthands: css off
1616
!Commits: <a href=https://twitter.com/encodings>@encodings</a>
1717
!Tests: <a href=https://github.com/w3c/web-platform-tests/tree/master/encoding>web-platform-tests encoding/</a> (<a href=https://github.com/w3c/web-platform-tests/labels/encoding>ongoing work</a>)
1818
!Translation (non-normative): <span title=Japanese><a href=https://triple-underscore.github.io/Encoding-ja.html lang=ja hreflang=ja rel=alternate>日本語</a></span>
19-
Translate IDs: dictdef-textdecoderoptions textdecoderoptions,dictdef-textdecodeoptions textdecodeoptions
19+
Translate IDs: dictdef-textdecoderoptions textdecoderoptions,dictdef-textdecodeoptions textdecodeoptions,index section-index
2020
</pre>
2121

2222
<link rel=stylesheet href=visualization-colors.css>
@@ -624,7 +624,7 @@ form submission, which both need exactly this.
624624

625625
<h2 id=indexes>Indexes</h2>
626626

627-
<p>Most legacy <a for=/>encodings</a> make use of an <dfn>index</dfn>. An
627+
<p>Most legacy <a for=/>encodings</a> make use of an <dfn id=index>index</dfn>. An
628628
<a>index</a> is an ordered list of entries, each entry consisting of a pointer and a
629629
corresponding code point. Within an <a>index</a> pointers are unique and code points can be
630630
duplicated.
@@ -1113,7 +1113,7 @@ control.
11131113
<hr>
11141114

11151115
<dl class=domintro>
1116-
<dt><code><var>decoder</var> = new <a constructor for=TextDecoder>TextDecoder([<var>label</var> = "utf-8" [, <var>options</var>]])</a></code>
1116+
<dt><code><var>decoder</var> = new <a constructor for=TextDecoder lt=TextDecoder()>TextDecoder([<var>label</var> = "utf-8" [, <var>options</var>]])</a></code>
11171117
<dd>
11181118
<p>Returns a new {{TextDecoder}} object.
11191119
<p>If <var>label</var> is either not a <a>label</a> or is a
@@ -1131,13 +1131,13 @@ control.
11311131
<dt><code><var>decoder</var> . <a attribute for=TextDecoder>ignoreBOM</a></code>
11321132
<dd><p>Returns true if <a for=TextDecoder>ignore BOM flag</a> is set, and false otherwise.
11331133

1134-
<dt><code><var>decoder</var> . <a method for=TextDecoder>decode([<var>input</var> [, <var>options</var>]])</a></code>
1134+
<dt><code><var>decoder</var> . <a method for=TextDecoder lt=decode()>decode([<var>input</var> [, <var>options</var>]])</a></code>
11351135
<dd>
1136-
<p>Returns the result of running <a for=TextDecoder>encoding</a>'s <a for=/>decoder</a>. The method can
1137-
be invoked zero or more times with <var>options</var>'s <code>stream</code> set to true, and then
1138-
once without <var>options</var>'s <code>stream</code> (or set to false), to process a fragmented
1139-
stream. If the invocation without <var>options</var>'s <code>stream</code> (or set to false) has
1140-
no <var>input</var>, it's clearest to omit both arguments.
1136+
<p>Returns the result of running <a for=TextDecoder>encoding</a>'s <a for=/>decoder</a>. The
1137+
method can be invoked zero or more times with <var>options</var>'s <code>stream</code> set to
1138+
true, and then once without <var>options</var>'s <code>stream</code> (or set to false), to process
1139+
a fragmented stream. If the invocation without <var>options</var>'s <code>stream</code> (or set to
1140+
false) has no <var>input</var>, it's clearest to omit both arguments.
11411141

11421142
<pre class=example id=example-end-of-stream><code class=lang-javascript>
11431143
var string = "", decoder = new TextDecoder(encoding), buffer;
@@ -1187,8 +1187,8 @@ method, when invoked, must run these steps:
11871187

11881188
<ol>
11891189
<li><p>If the <a for=TextDecoder>do not flush flag</a> is unset, set <a for=TextDecoder>decoder</a>
1190-
to a new <a for=TextDecoder>encoding</a>'s <a for=/>decoder</a>, set <a for=TextDecoder>stream</a> to a
1191-
new <a for=/>stream</a>, and unset the <a for=TextDecoder>BOM seen flag</a>.
1190+
to a new <a for=TextDecoder>encoding</a>'s <a for=/>decoder</a>, set <a for=TextDecoder>stream</a>
1191+
to a new <a for=/>stream</a>, and unset the <a for=TextDecoder>BOM seen flag</a>.
11921192

11931193
<li><p>If <var>options</var>'s <code>stream</code> is true, set the
11941194
<a for=TextDecoder>do not flush flag</a>, and unset the <a for=TextDecoder>do not flush flag</a>
@@ -1216,8 +1216,9 @@ method, when invoked, must run these steps:
12161216
is set, then return <var>output</var>, <a lt="serialize stream">serialized</a>.
12171217

12181218
<p class=note>The way streaming works is to not handle <a>end-of-stream</a> here when the
1219-
<a for=TextDecoder>do not flush flag</a> is set and to not unset that flag. That way in a subsequent invocation
1220-
<a for=TextDecoder>decoder</a> is not set anew in the first step of the algorithm and its state is preserved.
1219+
<a for=TextDecoder>do not flush flag</a> is set and to not unset that flag. That way in a
1220+
subsequent invocation <a for=TextDecoder>decoder</a> is not set anew in the first step of the
1221+
algorithm and its state is preserved.
12211222

12221223
<li>
12231224
<p>Otherwise:
@@ -1250,8 +1251,8 @@ interface TextEncoder {
12501251
<p>A {{TextEncoder}} object has an associated <dfn for=TextEncoder>encoder</dfn>.
12511252

12521253
<p class="note no-backref">A {{TextEncoder}} object offers no <var>label</var> argument as it only
1253-
supports <a>UTF-8</a>. It also offers no <code>stream</code> option as no <a for=/>encoder</a> requires
1254-
buffering of scalar values.
1254+
supports <a>UTF-8</a>. It also offers no <code>stream</code> option as no <a for=/>encoder</a>
1255+
requires buffering of scalar values.
12551256

12561257
<hr>
12571258

@@ -1262,7 +1263,7 @@ buffering of scalar values.
12621263
<dt><code><var>encoder</var> . <a attribute for=TextEncoder>encoding</a></code>
12631264
<dd><p>Returns "<code>utf-8</code>".
12641265

1265-
<dt><code><var>encoder</var> . <a method for=TextEncoder>encode([<var>input</var> = ""])</a></code>
1266+
<dt><code><var>encoder</var> . <a method for=TextEncoder lt=encode()>encode([<var>input</var> = ""])</a></code>
12661267
<dd><p>Returns the result of running <a>UTF-8</a>'s <a for=/>encoder</a>.
12671268
</dl>
12681269

@@ -2688,11 +2689,12 @@ issues. Browsers also should disable this feature if the resource was decoded us
26882689
<p>A single-byte buffer for <a>gb18030</a> (an <a>ASCII byte</a>) and <a>ISO-2022-JP</a> (0x24 or
26892690
0x28).
26902691

2691-
<p class="example">For <a>gb18030</a> when hitting a bogus byte while <a>gb18030 third</a> is not
2692-
0x00, <a>gb18030 second</a> could be moved into the single-byte buffer to be returned next, and
2693-
<a>gb18030 third</a> would be the new <a>gb18030 first</a>, checked for not being 0x00 after the
2694-
single-byte buffer was returned and emptied. This is possible as the range for the first and third
2695-
byte in <a>gb18030</a> is identical.
2692+
<p class=example id=example-gb18030-implementation-strategy>For <a>gb18030</a> when hitting a
2693+
bogus byte while <a>gb18030 third</a> is not 0x00, <a>gb18030 second</a> could be moved into the
2694+
single-byte buffer to be returned next, and <a>gb18030 third</a> would be the new
2695+
<a>gb18030 first</a>, checked for not being 0x00 after the single-byte buffer was returned and
2696+
emptied. This is possible as the range for the first and third byte in <a>gb18030</a> is
2697+
identical.
26962698
</ol>
26972699

26982700
<p>The <a>ISO-2022-JP encoder</a> needs <a>ISO-2022-JP encoder state</a> as additional state, but

0 commit comments

Comments
 (0)