- protected function makeHeader( $header ) {
- $spanAttribs = [ 'class' => 'mw-headline', 'id' => Sanitizer::escapeId( $header ) ];
+ protected function makeHeader( $header, $canonicalId ) {
+ $spanAttribs = [ 'class' => 'mw-headline', 'id' => Sanitizer::escapeIdForAttribute( $header ) ];
+ $h2Attribs = [ 'id' => Sanitizer::escapeIdForAttribute( $canonicalId ) ];