Commit graph

31 commits

Author SHA1 Message Date
jenkins-bot bc13671078 Merge "ApiQueryExtracts: Use raw text from ParserOutput" 2024-11-15 15:36:35 +00:00
jenkins-bot 23791622e0 Merge "Use extension namespace for TextExtracts" 2024-09-12 16:05:21 +00:00
James D. Forrester 919fc17a13 build: Update MediaWiki requirement to 1.43
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: Id189f2bcee4f05501bf2f361579f036ec64614b3
2024-08-22 18:33:38 -04:00
Bartosz Dziewoński 207242f93d ApiQueryExtracts: Use raw text from ParserOutput
Use ParserOutput::getRawText() instead of deprecated getText().
This avoids a dependency on MediaWiki\OutputTransform classes,
which call into Skin and lots of other scary code.

Small updates are needed so that we continue stripping the TOC
and section edit links in this format.

This simultaneously reverts two patches that were only needed to work
around problems caused by markup added by OutputTransforms:
* Revert "Skip <h2> in TOC when extracting first section"
  This reverts commit 60e1c5ad83.
* Revert "ExtractFormatter: Rescue headings from being removed"
  This reverts commit 0fafa44a20.

Change-Id: Ie436576a356d05f2c4c4b84c8c1d82ba70d357d4
2024-07-16 15:21:59 +00:00
alistair3149 cc8cf471fc
Use extension namespace for TextExtracts
Change-Id: I01177e9bef0f25b6245ee3e93f605dc771642273
2024-07-12 18:46:33 -04:00
jenkins-bot 4e9b6273f4 Merge "Add extracts to REST search as description" 2024-07-12 17:41:19 +00:00
alistair3149 fe3982c204 Add extracts to REST search as description
Add the config $wgExtractsExtendRestSearch to enable adding the extracts
to REST search as description. It is disabled by default.

Change-Id: I4335f161856b3a4035333de6eb4f547745480d91
2024-07-12 07:10:30 +00:00
Umherirrender 290be2e8de Replace deprecated ApiPageSet::getGoodTitles
PageIdentity does not have inNamespace() (it is from LinkTarget)
PageIdentity does not have getContentModel(), use the WikiPage instead
Inject a TitleFormatter to get the prefixed title text

Bug: T339384
Change-Id: I0029e718f20ca01ee3cd13ada8be04a16480d51d
2024-07-05 22:05:55 +02:00
James D. Forrester 1d612045c0 build: Update MediaWiki requirement to 1.42
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: I29fd0a17e6f5bf8da5f4a436fbfaa08585218963
2024-01-12 18:33:00 -05:00
James D. Forrester 7cf9db11ca build: Update MediaWiki requirement to 1.41
All extensions in the MediaWiki tarball are expected to track MediaWiki's release directly.

Change-Id: Ica46fa97ca72a58192ff90447f2a72d3d90b4b4a
2023-08-19 14:09:59 +08:00
Umherirrender ce0bcb5c82 Use HookHandlers for core hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T271032
Change-Id: I612c09264b830fe5588aafdad80a9eebaa66d71b
2023-08-14 19:49:09 +02:00
gerritbot bdd77c5c06 Update moved class FauxRequest
See T321882. Moved in I832b133aaf61ee

Bug: T321681
Change-Id: I6ce2acc3961db1b9663efd62ebdcf57c905caaf0
2023-05-19 10:25:20 +00:00
Arlo Breault d67f9a73d5 Remove figures from text extracts
Bug: T318727
Change-Id: I304d4b794a0f27eb78ef013f911c444fc9a80cf1
2022-09-27 13:13:24 -04:00
Alexander Vorwerk abcb71cabb ApiQueryExtracts: inject WikiPageFactory
Bug: T297688
Change-Id: I8faa8a14efcd6cb6b247301aa4da0c1abac7c97b
2021-12-14 23:05:40 +01:00
Reedy 20c3f6d447 Replace use of deprecated MWTidy class
Bump required MW to >= 1.36.0

Change-Id: Ida40e6c1d84eec0e51e53f6aa98ac9f09fd52666
2021-10-20 19:33:39 +01:00
DannyS712 d7f93f5c17 ApiQueryExtracts: remove unneeded factory method
All services can be injected by bumping minimum
version of mediawiki (1.34 would be enough, but
since that is no longer supported require 1.35)

Change-Id: I8bb1573a02932ef5f2871606e94a41afe073fd00
2021-04-01 20:07:30 +00:00
Reedy 9a2aacde39 Convert to manifest_version 2
Bug: T252470
Change-Id: I514df27723fddc635968dc1ee38db38bd1ab1fa8
2020-05-12 02:05:32 +01:00
Timo Tijhof 0453a3155f Remove unused 'OpenSearchXml' hook handler
This is the equivalent of the current 'ApiOpenSearchSuggest' hook
as it once existed in the "OpenSearchXml" MediaWiki extension,
which merged into core and archived three years ago.

Change-Id: Ibe244851857ddff3a437acb12c3cc7660eb89089
2019-12-16 18:34:19 +00:00
Alex Monk 7683625d9e Split apihelp messages to a separate file
Bug: T189982
Change-Id: I719dd65bfe502094fa7b12d5d67d45f92d9daf5b
2019-08-25 00:00:59 +01:00
Max Semenik e234409518 Use AutoloadNamespaces
Change-Id: I4cbf02365c6a33431e6614d971ac12f0a67823a9
2019-03-17 18:32:26 -07:00
Fomafix 375f6d3574 Use PHP7 syntax features
* Use the ?? operator.
* Use "\u{00A0}" instead of "\xC2\xA0".

Also increase the minimum required MediaWiki version from 1.30 to 1.31
because 1.31 requires PHP7.

Change-Id: Ic5c279976f50b381cec65e74b7cc821a210c2173
2019-02-02 21:58:54 +01:00
TheDJ 93076cf47e Raise mediawiki requirement to 1.30
Uses MediaWikiServices::getInstance()->getParserCache() only
available since 1.30

Bug: T205916
Change-Id: I388a09b443aa57ae88f36029a7656625373f82a1
2018-10-03 12:23:58 +00:00
Kunal Mehta adfde34586 Use SPDX 3.0 license identifier
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.

Bug: T183858
Change-Id: I78f8a3b4e06363a6af4a79189d1ff68697b34dcd
2018-03-02 15:43:49 -08:00
Piotr Miazga 91bbe7b10a Hygiene: Remove deprecation and unused import
Changes:
 - ApiBase::setWarning() is deprecated, use addWarning() instead
 - ParserCache::singleton() is deprecated, use MediaWikiServices instead
 - Exception import is not used, drop it
 - added MediaWiki 1.29 as a requirement

Bug: T166714
Change-Id: Ib81e5acbb28e1f803c7a792b9f990f2aa6d57521
2017-08-02 16:32:13 +02:00
jdlrobson e9e261908d Play things safe when stripping HTML
Script and input tags if outputted by other extensions can
theoretically allow an XSS issue.

Just in case let's do this here.

Bug: T107206
Change-Id: I889f7827fb9084b7cf853a1843fdc48821237d65
2017-06-29 10:46:57 -07:00
Brad Jorsch 93e648c872 Add <style> to list of tags to remove
For future compatibility with TemplateStyles.

Change-Id: I473f176a66a694c7a9f4e11d5c6183af8f9ca2ad
2017-05-16 18:10:59 +00:00
Kaldari 57f346f06a Adding sortkey class to ExtractsRemoveClasses
Bug: T126331
Change-Id: I6825356464b2efdf937e0e223ae0cb3cd3a0acf0
2017-03-26 23:02:21 -07:00
Reedy ad435fb4e1 Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: Iaff2e40a8bddfd5d45170b49641b8afa15987527
2016-08-23 14:54:47 +01:00
Kghbln 7237099af9 Provide missing license lable to show on "Special:Version"
Bug: T123943
Change-Id: Iaf9209ca0f6e6c48c3241b19d0a2d9c6c7bf214a
2016-04-08 09:49:06 +02:00
Sergey Leschina f321fc541a Add ol.references to ignored elements
Bug: T74629
Change-Id: Iff299bd7eb430f27c682206bf7abc00ac0c5eefb
2016-03-29 01:50:45 +03:00
mhutti1 80703452ed Converted TextExtracts to new extension registration system
Moved most of TextExtracts.php to the new extension.json
and added method for backward compatable implementation
of the extension if still called though the php file. Moved
unit test hook to Hooks.php and deleted old il8n.php.

Bug: T87979
Change-Id: I3d26bd931ad2941268b94474f3e6327282da24ec
2015-12-10 22:59:49 +01:00