Don't show page previews on hash fragments

Bug: T198652
Change-Id: I036266bf4fb98ffa20509440e553b29e8dcc4e1f
This commit is contained in:
Jon Robson 2023-01-11 08:36:51 -08:00
parent c9366fda5d
commit 7ab0b63f80
3 changed files with 9 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -43,7 +43,15 @@ const EXCLUDED_LINK_SELECTORS = [
'.mw-cite-backlink a',
'.oo-ui-buttonedElement-button',
'.ve-ce-surface a', // T259889
'.cancelLink a'
'.cancelLink a',
// T198652: lists to hash fragments are ignored.
// Note links that include the path will still trigger a hover,
// e.g. <a href="Foo#foo"> will trigger a preview but <a href="#foo"> will not.
// This is intentional behaviour that will not be handled by page previews, to avoid
// introducing complex behaviour. If a link must include the path it should make use of
// the .mw-selflink-fragment class.
'.mw-selflink-fragment',
'[href^="#"]'
];
/**