Open xuexb opened 6 years ago
源代码(示例):
<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>
而又命中了核心代码的链接规则:
https://github.com/mipengine/mip/blob/2af390cf5f2fa4746efa212bd568230489cea144/src/viewer.js#L235-L263
导航经过 MIP-Cache 后(线上),原生的 HTML 锚点不能使用,点击直接跳转到源站了。
期望的:
href="#"
window.top.location.href
AMP-Cache 结果:
<a href=#>#</a> <a href=#1>#1</a> <a href=#2>#2</a> <a href=#a>#a</a>
示例:https://static-xuexb-com.cdn.ampproject.org/v/s/static.xuexb.com/html/test-anchor-amp.html?d=1&_js_v=0.1&usqp=mq331AQGCAEYASAB#
源代码(示例):
经过 MIP-Cache 解析后(示例):
而又命中了核心代码的链接规则:
https://github.com/mipengine/mip/blob/2af390cf5f2fa4746efa212bd568230489cea144/src/viewer.js#L235-L263
导航经过 MIP-Cache 后(线上),原生的 HTML 锚点不能使用,点击直接跳转到源站了。