mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-23 15:56:52 +00:00
60e1c5ad83
This piece of code is only relevant in case when: - the intro section is requested (either in plaintext or html); - the parse result for the full page is available in the parser cache; - the full extract is not available in the TextExtracts WAN cache; - the intro is also not available in the TextExtracts WAN cache. In this case getFirstSection() is called with the parser output, which is different from the the convertText() output it is called with in other code paths, and still contains <h*> tags. A quick regex is used to extract the first section. This stops at any <h2>. A TOC also contains a <h2> (which will be removed later via $wgExtractsRemoveClasses). This one needs to be ignored in case the TOC is placed before the first section using e.g. the __TOC__ keyword. The patch changes the regex so it ignores a h2 with id="mw-toc-heading", but keeps working in plaintext mode when <h*> tags are not present (the code path when the intro section is requested, and the full extract is available in the TextExtracts WAN cache but the intro extract isn't). Bug: T269967 Change-Id: I0a495d06cf1725744e556e81f17047fb53f53521 |
||
---|---|---|
.phan | ||
i18n | ||
includes | ||
tests/phpunit | ||
.eslintrc.json | ||
.gitignore | ||
.gitreview | ||
.phpcs.xml | ||
CODE_OF_CONDUCT.md | ||
composer.json | ||
COPYING | ||
extension.json | ||
Gruntfile.js | ||
package-lock.json | ||
package.json |