当 id 包含特殊字符时,为什么维基百科使用第二个 html 锚点
Why wikipedia use a second html anchor when the id contains special characters
维基百科建议在属性 id 中使用特殊字符时提供手动锚点,尤其是当它用作 anchor 时(抱歉,它似乎只有法语)。
关于这个建议,我有两个问题:
- 是支持特定浏览器还是支持所有浏览器?我找不到有关此类问题的任何信息
- 内容 "Encres_.C3.A0_.C3.A9crire_et_dessiner" 中使用的编码 format/language 是什么?。我们可以改用 html 个实体吗?
示例:https://fr.wikipedia.org/wiki/Encre#Encres_%C3%A0_%C3%A9crire_et_dessiner
<span id="Encres_.C3.A0_.C3.A9crire_et_dessiner"></span>
<span class="mw-headline" id="Encres_à_écrire_et_dessiner">Encres à écrire et dessiner</span>
HTML4 时代使用的旧 ID 格式的向后兼容性。 HTML4 只允许在 ID 中使用少数非字母数字字符。格式类似于 percent encoding 但用点而不是百分号(这也是不允许的),加上点本身没有被编码(不像百分号编码中的百分号),使得这种格式有点破。
维基百科建议在属性 id 中使用特殊字符时提供手动锚点,尤其是当它用作 anchor 时(抱歉,它似乎只有法语)。
关于这个建议,我有两个问题:
- 是支持特定浏览器还是支持所有浏览器?我找不到有关此类问题的任何信息
- 内容 "Encres_.C3.A0_.C3.A9crire_et_dessiner" 中使用的编码 format/language 是什么?。我们可以改用 html 个实体吗?
示例:https://fr.wikipedia.org/wiki/Encre#Encres_%C3%A0_%C3%A9crire_et_dessiner
<span id="Encres_.C3.A0_.C3.A9crire_et_dessiner"></span>
<span class="mw-headline" id="Encres_à_écrire_et_dessiner">Encres à écrire et dessiner</span>
HTML4 时代使用的旧 ID 格式的向后兼容性。 HTML4 只允许在 ID 中使用少数非字母数字字符。格式类似于 percent encoding 但用点而不是百分号(这也是不允许的),加上点本身没有被编码(不像百分号编码中的百分号),使得这种格式有点破。