Skip to content

Lead section detection broken under both mw-heading and Parsoid #23

Description

@HakanIST

The > h2 selector used to find the first heading (line 271) no longer works:

elements = $( '.mw-parser-output > h2' ).first().prevAll();
  1. Legacy parser: headings are now wrapped in div.mw-heading, so there are no h2 elements as direct children of .mw-parser-output.
  2. Parsoid (T430194): content is wrapped in <section> elements (T333031), so neither headings nor the short description are direct children.

In both cases elements is empty, so section stays undefined and the full page wikitext is always downloaded instead of just section 0. Not a functional break, but an unnecessary performance hit on every page load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions