Skip to content

Commit

Permalink
Add examples for collect an HTTP quoted string
Browse files Browse the repository at this point in the history
And remove a confusing note.

Closes #1068.
  • Loading branch information
annevk committed Aug 6, 2020
1 parent c08e612 commit 1b1239a
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions fetch.bs
Expand Up @@ -307,9 +307,31 @@ and optionally an <var>extract-value flag</var>, run these steps:
inclusive, within <var>input</var>.
</ol>

<p class="note no-backref">The <var>extract-value flag</var> argument makes this algorithm suitable
for <a for="header list">getting, decoding, and splitting</a> and <a>parse a MIME type</a>, as well
as other header value parsers that might need this.
<div class=example id=example-http-quoted-string>
<table>
<tr>
<th>Input
<th>Output
<th>Output with the <var>extract-value flag</var> set
<th>Final <a>position variable</a> value
<tr>
<td>"<code><mark>"\</mark></code>"
<td>"<code>"\</code>"
<td>"<code>\</code>"
<td>2
<tr>
<td>"<code><mark>"Hello"</mark> World</code>"
<td>"<code>"Hello"</code>"
<td>"<code>Hello</code>"
<td>7
<tr>
<td>"<code><mark>"Hello \\ World\""</mark></code>"
<td>"<code>"Hello \\ World\""</code>"
<td>"<code>Hello \ World"</code>"
<td>18
</table>
<p class=tablenote><small>The <a>position variable</a> always starts at 0 in these examples.</small>
</div>


<h4 id=methods>Methods</h4>
Expand Down

0 comments on commit 1b1239a

Please sign in to comment.