Greg_Lumiere a écrit :
Bonjour,
A noter que les guillemets deviennent obligatoires dès lors que l'uri contient au moins un espace.
En complément des réponses précédentes, cf. méthode d'analyse d'un url_token telle que décrite par le W3C pour la spécification CSS3 :
Execute the following steps in order:
1 - Initially create a <url-token> with its value set to the empty string.
2 - Consume as much whitespace as possible.
3 - If the next input code point is EOF, return the <url-token>.
4 - If the next input code point is a U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE (‘), then:
1 - Consume a string token with the current input code point as the ending code point.
2 - If a <bad-string-token> was returned, consume the remnants of a bad url, create a <bad-url-token>, and return it.
3 - Set the <url-token>’s value to the returned <string-token>’s value.
4 - Consume as much whitespace as possible.
5 - If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF, consume it and return the <url-token>; otherwise, consume the remnants of a bad url, create a <bad-url-token>, and return it.
5 - Repeatedly consume the next input code point from the stream:
U+0029 RIGHT PARENTHESIS ())
EOF
Return the <url-token>.
whitespace
Consume as much whitespace as possible. If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF, consume it and return the <url-token>; otherwise, consume the remnants of a bad url, create a <bad-url-token>, and return it.
U+0022 QUOTATION MARK (")
U+0027 APOSTROPHE (’)
U+0028 LEFT PARENTHESIS (()
non-printable code point
This is a parse error. Consume the remnants of a bad url, create a <bad-url-token>, and return it.
U+005C REVERSE SOLIDUS
If the stream starts with a valid escape, consume an escaped code point and append the returned code point to the <url-token>’s value.
Otherwise, this is a parse error. Consume the remnants of a bad url, create a <bad-url-token>, and return it.
anything else
Append the current input code point to the <url-token>’s value.