Skip to content
  • jdlrobson's avatar
    245dd246
    Harden nested references click handler against different markup · 245dd246
    jdlrobson authored
    The nested reference click handler relied on the sup having a single
    child 'a' that was always the target. If MediaWiki:Cite_reference_link is edited
    this is not always true - for example a `span` wrapping [ and ]
    can also be the child of the sup (and a child of the link) which
    results in the link being followed.
    
    The click handler is updated to always run on the `sup` element
    using querySelector to access the single link element.
    
    The link default behavior is suppressed separately via another
    event.
    
    Bug: T258096
    Change-Id: I0d5bb398e99465ade357743dd3ff34ae551243c5
    245dd246
    Harden nested references click handler against different markup
    jdlrobson authored
    The nested reference click handler relied on the sup having a single
    child 'a' that was always the target. If MediaWiki:Cite_reference_link is edited
    this is not always true - for example a `span` wrapping [ and ]
    can also be the child of the sup (and a child of the link) which
    results in the link being followed.
    
    The click handler is updated to always run on the `sup` element
    using querySelector to access the single link element.
    
    The link default behavior is suppressed separately via another
    event.
    
    Bug: T258096
    Change-Id: I0d5bb398e99465ade357743dd3ff34ae551243c5
Loading