gpt4 book ai didi

URL 中的 HTML5 含糊不清的符号

转载 作者:太空宇宙 更新时间:2023-11-04 15:13:55 24 4
gpt4 key购买 nike

W3C Validator在我的一些 URL 中引发了关于 & 符号的错误。例如:

<link href="min/?f=static/css/reset.css,static/css/main5.css&2" rel="stylesheet">

根据HTML5 spec ,然而,验证器是错误的:

An ambiguous ampersand is a U+0026 AMPERSAND character (&) that is followed by one or more alphanumeric ASCII characters, followed by a U+003B SEMICOLON character (;), where these characters do not match any of the names given in the named character references section.

This site得出相同的结论,并指出目前没有验证者正确实现规范。

有什么确定的吗?

最佳答案

我相信你是对的 - 根据以下线程,这是 a bug in the HTML5 validator .我不知道这是否是“最终的”,因为它不是官方声明(但我认为回复中的名字至少是 SO 上知名成员的名字)。

您尝试执行的操作在 HTML5 中确实有效(在特定情况下,例如您的情况)。

以下是该错误报告的摘录以供引用:

原帖:

<img src="http://codx.altervista.org/scripts/php/image.phpimg=/membri/codx/grafica
/articles_covers/cover_t3dc1360866428.jpg&h=96" alt="Teeter 3D contesT" />

"Simply, that & does not have to be escaped to &amp;" - Source.

主题回答/解释:

That's right, in HTML5. It's a bug in the validator that it says otherwise, see http://lists.w3.org/Archives/Public/www-validator/2013Mar/0009.html. The unstable development version of the validator, http://qa-dev.w3.org:8888/ has this bug fixed (and your document validates in it).

This may, in part, reflect the nature of HTML5 validator as experimental software that checks against some "specification" which is not identified in public and which may change at any moment without notice and often does. - Source.

注意 - 上面的摘录没有改变,但不是完整的问题/答案,只是片段。建议任何 future 的读者查看链接到此答案顶部的线程,以获取完整的问题以及为什么会出现此行为的解释。

关于URL 中的 HTML5 含糊不清的符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17374087/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com