Open caugner opened 3 hours ago
This specific occurrence seems to have been a side-effect of https://github.com/mdn/content/pull/36792, where /docs/Web/HTTP/Headers/Content-Security-Policy/Sources was removed and redirected to docs/Web/HTTP/Headers/Content-Security-Policy#fetch_directive_syntax.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#report-sample exists, so what we should have done in this case almost is to fetch the page, look if an id
corresponding to the current hash exists, and use that.
/cc @fiji-flo It would be useful, if the index.json
contained a list or map of all anchors of the page. Is this something you have considered, or would consider for a future version of rari? (Side-note: This would also be useful for "redirecting" en-US anchors on other locales to the localized anchor, which I have mentioned recently.)
Anchors are a lovely topic. One of my biggest goals is to move to GFM like anchors which would help a lot.
I don't want to add more redundant data to the index.json
. However, validating id/anchors and using them for redirects and and other task is on the agenda.
For this case it would not be straight forward, just because and id (and thereby a heading) matches doesn't imply that where we should point. There's lot of pages that have the same id many times (with a unique added suffix) which makes this even worth.
Thanks for raising this.
Thanks Florian.
@queengooborg Maybe what we should do is to change the behavior as follows: _Error if the current mdn_url
contains an anchor, and don't auto-fix it._ Wdyt?
What type of issue is this?
Linter issue
What is the issue?
If a feature has an
mdn_url
that points to an anchor of an MDN page, and that page is removed and redirected to another page with an anchor, then this redirect target replaces themdn_url
and the current anchor gets lost, even if the redirect target has an anchor corresponding to the oldmdn_url
.See: https://github.com/mdn/browser-compat-data/pull/25138/commits/4c58e86a0317f28a7ada2d5f9d6daa5f55f711f0
What behavior were you expecting?
We should have not overwritten these specific MDN urls.
What version(s) of BCD is the issue present in?
main
branchDo you have anything more you want to share?
No response