MIP 中锚点定位问题
xuexb opened this issue · 2 comments
xuexb commented
源代码(示例):
<a href="#">#</a>
<a href="#1">#1</a>
<a href="#2">#2</a>
<a href="#a">#a</a>
经过 MIP-Cache 解析后(示例):
<a href="https://static.xuexb.com/html/test-anchor.html#">#</a>
<a href="https://static.xuexb.com/html/test-anchor.html#1">#1</a>
<a href="https://static.xuexb.com/html/test-anchor.html#2">#2</a>
<a href="https://static.xuexb.com/html/test-anchor.html#a">#a</a>
而又命中了核心代码的链接规则:
Lines 235 to 263 in 2af390c
导航经过 MIP-Cache 后(线上),原生的 HTML 锚点不能使用,点击直接跳转到源站了。
xuexb commented
期望的:
- MIP-Cache 不应该对页面中的
href="#"
开头的锚点进行转换 - 如果是锚点链接,在线上环境不应该
window.top.location.href
跳转,应该走浏览器原生的逻辑,毕竟原生态,健康品。
xuexb commented
AMP-Cache 结果:
<a href=#>#</a>
<a href=#1>#1</a>
<a href=#2>#2</a>
<a href=#a>#a</a>