Closed microJ closed 4 years ago
兼容设置 name="targetAnchor" 的锚点
html5 中锚点不应再设置 name 了吧
html5 中锚点不应再设置 name 了吧
@meteorlxy
经查 w3c 标明了 name 属性是废弃的:The name attribute on the a element is obsolete. Consider putting an id attribute on the nearest container instead.
但是查证 whatwg,表示 hash-name reference
that has an id or name attribute,fragment 对应元素查找过程解释在这里:https://html.spec.whatwg.org/#find-a-potential-indicated-element
这里应该是以 whatwg 为准的吧 =。=
Thanks! ❤️
Summary
Which package does this PR involve? (check one)
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)Other information:
问题描述: 复现链接,https://blog.expect2.cyou/views/front-end/2020/0824-speed-up-npm-install.html#5f447c564bdcde0006a8ffd6 ,打开控制台可以看到报错。 某些自动生成的hash以数字开头,直接使用
#123
作为 selectors 会报错。修改内容:
name="targetAnchor"
的锚点