Commit graph

182 commits

Author SHA1 Message Date
jenkins-bot d325abc0dd Merge "Truncate descriptions to a certain length" 2024-05-17 19:59:23 +00:00
libraryupgrader 8a63cae9e0 build: Updating grunt-banana-checker to 0.12.0
Change-Id: I91c07b443983db2e3606f43d482c52e6189bed30
2024-05-10 03:42:20 +00:00
libraryupgrader 7c56ad79d3 build: Updating composer dependencies
* mediawiki/minus-x: 1.1.1 → 1.1.3
* php-parallel-lint/php-parallel-lint: 1.3.2 → 1.4.0

Change-Id: I01ae354ba07961c5b02f9eb3817f4b79e8acf5ea
2024-05-05 15:35:35 +00:00
libraryupgrader 8607c097dc build: Updating eslint-config-wikimedia to 0.27.0
Change-Id: I47d24a8c0f01d6d859b8ab6116dac86bd974fac6
2024-04-17 03:50:59 +00:00
jenkins-bot 859b31417f Merge "Remove style tags in description" 2024-04-05 10:07:08 +00:00
libraryupgrader 4fc6b76c30 build: Updating mediawiki/mediawiki-codesniffer to 43.0.0
Change-Id: I0f13435b35a53329bda5e136490bdc90c3b1adf0
2024-03-17 16:52:30 +00:00
alex4401 c146909532
Truncate descriptions to a certain length
With this change, generated descriptions are cut at 300 characters, without breaking words when possible, and with an ellipsis added in case the cut happened mid-sentence.

The `Description2::getFirstChars` function was borrowed from TextExtracts with minor alterations (added comment for their regex, and removed `>` from word healing given it's unclear why it's been included).

New configuration variable `$wgDescriptionMaxChars` (proposed default: 300, which seems like a sensible amount) controls this behaviour.

This has been in testing on ark.wiki.gg (with the platform's approval, which I'm glad for) since early September. Without this change, we had a few pages with little sections having a huge part of their body text thrown into the `description` meta tag...

Depends-On: I585f2c0046571310aad67f3ba148c4f22aaae49f
Change-Id: I04b00f99085f07f773212ee3eca8470eece34e9e
2024-02-24 08:44:53 +01:00
xtex 055927a901 Remove style tags in description
Some pages' description may include CSS code rendered by [[Extension:TemplateStyles]].

Change-Id: I352ac2338eb5977305308546523ec6c55f7cb599
2024-02-14 07:16:19 +00:00
libraryupgrader bc54a5a120 build: Updating grunt-banana-checker to 0.11.1
Change-Id: I464c576ea6062676c41801fcb54d5b38f860793f
2024-02-10 08:38:23 +00:00
libraryupgrader 77db4d0127 build: Updating npm dependencies
* eslint-config-wikimedia: 0.25.1 → 0.26.0
* grunt-eslint: 24.0.1 → 24.3.0

Change-Id: I9dede31a39fd0f81f5f23fbca610bbbf8d0b5dda
2024-02-09 02:05:56 +00:00
libraryupgrader 8cf12f5160 build: Updating eslint-config-wikimedia to 0.25.1
Change-Id: I6a23f62934c754bc9e155f83e392fb25597e1119
2024-02-05 04:58:18 +00:00
libraryupgrader ebc5ca21e2 build: Updating npm dependencies
* eslint-plugin-compat: 4.0.2 → 4.2.0
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
* semver: 7.3.5 → 7.5.4
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw
* word-wrap: 1.2.3 → 1.2.5
  * https://github.com/advisories/GHSA-j8xg-fqg3-53r7

Change-Id: I555d14c23825f9a5402fb728bcbdb39fc03ac7d8
2024-02-03 17:36:45 +00:00
Translation updater bot cdb35a545d Localisation updates from https://translatewiki.net.
Change-Id: I77d92242f931574eb50615a66f351baba4c2ab99
2024-01-30 09:38:55 +01:00
Translation updater bot 43a4771737 Localisation updates from https://translatewiki.net.
Change-Id: I6a044c5e55e485253e2e9b64d5d9266b7394c2eb
2024-01-28 16:06:10 +01:00
alex4401 050086dd6e Do not try to derive descriptions if one has been specified already
Skip running the generator on interface messages and if a description has already been set. This resolves some annoyances ranging from performance (relevant if the algorithm becomes more expensive to run) to multiple description meta tags being spawned.

This is part of my RemexHtml patch chain, which I've split up to avoid having a single commit alter the majority of the codebase. If it ends up being rejected, I can rebase this change to rid of dependencies on the rest of the chain.

Depends-On: I97fd065c9554837747021ba9fff26005e33270f4
Change-Id: I585f2c0046571310aad67f3ba148c4f22aaae49f
2024-01-12 08:28:31 +00:00
alex4401 b73fe26c29 Extract description algorithm into a new class
Separating the extract algorithm from integration code. This results in a slightly cleaner code structure (at least in my opinion) and enables adding alternate algorithms without devolving into spaghetti.

The DescriptionProvider (name of the new base interface) is exposed as a service through dependency injection to avoid factories. The implementation can be swapped at service instantiation time.

Depends-On: I73c61ce045dcf31ac1ca5888f1548de8fd8b56ff
Change-Id: I97fd065c9554837747021ba9fff26005e33270f4
2024-01-12 08:24:19 +00:00
alex4401 43eb47183e Switch to hook handlers and inject ConfigFactory
Moving hooks into a separate class, and using dependency injection for configuration. Due to hook interfaces being added in MW 1.35, this change also raises the MediaWiki requirement to >1.35.0.

This patch is a part of my RemexHtml deriver chain (split into multiple patches to avoid a single commit altering almost the entirety of the codebase), which raises the floor to 1.38 later. There's not really a point in merging this if the rest of the patch chain is declined.

Depends-On: I484feeb51beab0c2e06c9f958a1c15c40853b967
Change-Id: I73c61ce045dcf31ac1ca5888f1548de8fd8b56ff
2024-01-11 22:44:02 +00:00
alex4401 15f2edbaee Use namespace autoloading instead of manually tracking classes
This extension's classes have already been namespaced. Perhaps wrongly, but I don't see any showstoppers against using PSR-4 autoloading here.

Change-Id: I484feeb51beab0c2e06c9f958a1c15c40853b967
2023-12-07 15:37:32 +00:00
Translation updater bot 323c797f28 Localisation updates from https://translatewiki.net.
Change-Id: I2d4a3bc2a96f98c22d115c5a721a2a40ba8d5af6
2023-09-13 08:31:48 +02:00
Translation updater bot 1f10d667fe Localisation updates from https://translatewiki.net.
Change-Id: Id6bd7d7432289c887e6144f02c330d00b747048f
2023-07-31 08:57:09 +02:00
libraryupgrader 2d68312307 build: Updating grunt-banana-checker to 0.11.0
Change-Id: Ieaa8314b65d77e77367af692476a0bb03bd4a9ca
2023-06-01 04:19:12 +00:00
libraryupgrader 6cbe68fa54 build: Updating npm dependencies
* eslint-config-wikimedia: 0.24.0 → 0.25.0
* grunt-eslint: 24.0.0 → 24.0.1

Change-Id: Ia12348aa1098e03ee65fcffc3c7bde2d208a40bd
2023-05-04 01:54:14 +00:00
libraryupgrader cab185a2a6 build: Updating npm dependencies
* eslint-config-wikimedia: 0.22.1 → 0.24.0
* grunt: 1.5.3 → 1.6.1

Change-Id: I8240834199bd51f76664026759e27903b718fec5
2023-03-15 04:47:13 +00:00
libraryupgrader 4cd70b8e7e build: Updating mediawiki/mediawiki-codesniffer to 41.0.0
Change-Id: If0f4df5a40f2c5fbd63535b5d895d4a7934f265b
2023-03-12 00:41:07 +00:00
Translation updater bot 655b11d7ea Localisation updates from https://translatewiki.net.
Change-Id: I550012a6b7562a647cc3a87bc86ba19ef2199e67
2023-01-05 09:07:56 +01:00
Translation updater bot 4ba5e24b71 Localisation updates from https://translatewiki.net.
Change-Id: I41b7a5e2b0855b79da83eb4852398587f768603a
2022-12-21 09:14:56 +01:00
libraryupgrader dbc034f125 build: Updating mediawiki/mediawiki-codesniffer to 40.0.1
Change-Id: I8a3d0295a57e7cbb8776e637e3b191b3bc0ce60e
2022-11-16 04:50:22 +00:00
libraryupgrader e83256f305 build: Updating minimatch to 3.0.8
* https://github.com/advisories/GHSA-f8q6-p94x-37v3

Change-Id: Ie10e39d694879722b03e824626eed6494486aa74
2022-10-21 04:25:30 +00:00
libraryupgrader 6b4777721f build: Updating grunt-banana-checker to 0.10.0
Change-Id: I9488e108b555de13447db3a9e339f250330c2d09
2022-10-06 01:59:41 +00:00
libraryupgrader d2a5322a44 build: Updating grunt to 1.5.3
Change-Id: Ic14500ab823ac82074ca6eed50ea1abea65af98e
2022-05-26 10:07:42 +00:00
libraryupgrader 6eca5a303c build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 38.0.0 → 39.0.0
* php-parallel-lint/php-console-highlighter: 0.5.0 → 1.0.0
* php-parallel-lint/php-parallel-lint: 1.3.1 → 1.3.2

npm:
* grunt-eslint: 23.0.0 → 24.0.0

Change-Id: Ic5c5cb36ad85238dbc5a1cbaec3f3ea0e3eda707
2022-05-21 02:41:53 +00:00
libraryupgrader bd9bc72317 build: Updating grunt to 1.5.2
Change-Id: I50c0ad5627d769697a5ff1d9e5b93511ad2177b9
2022-04-27 09:39:11 +00:00
libraryupgrader d53638e642 build: Updating npm dependencies
* eslint-config-wikimedia: 0.21.0 → 0.22.1
* async: 3.2.0 → 3.2.3
  * https://github.com/advisories/GHSA-fwr7-v2mv-hh25

Change-Id: I92726e9b0cd4bec2839c03366bd1b9a450028917
2022-04-15 02:51:41 +00:00
Translation updater bot 23e0582f58 Localisation updates from https://translatewiki.net.
Change-Id: I331d9b42ca98f0fea2f9598b89450f93b0d9cf95
2022-02-25 09:43:17 +01:00
C. Scott Ananian b269304773 ParserOutput::getPageProperty() now returns null when key is missing.
The return value of ParserOutput::getPageProperty() has transitioned
to returning `null` instead of `false` when the page property is missing.

Bug: T301915
Depends-On: Iaa25c390118d2db2b6578cdd558f2defd5351d15
Change-Id: I31d4115d75e080bb0177f30b2acf55ca2525a19d
2022-02-16 19:33:00 -05:00
C. Scott Ananian 84276905bc Update uses of ParserOutput::getPageProperty() to handle new return value
The return value of ParserOutput::getPageProperty() will transition to
returning `null` instead of `false` when the page property is missing.

Bug: T301915
Change-Id: Id95dbdd427310e4e1cf40330b149adfe2b68f848
2022-02-16 19:31:35 -05:00
libraryupgrader adc340542c build: Updating npm dependencies
* eslint-config-wikimedia: 0.20.0 → 0.21.0
* grunt: 1.4.0 → 1.4.1

Additional changes:
* Set `name` in package.json.

Change-Id: I80cb9a1386e4217c3d1721c1a76c556b31c9d3b1
2022-02-06 12:13:42 +00:00
Umherirrender 6d3b7ce782 Replace deprecated ParserOutput::getProperty
Change-Id: I9278120212bcd0c003af899ce9602c292edac947
2022-02-06 13:11:38 +01:00
Umherirrender 838ef90fe0 Set MediaWiki 1.31 as minimum requirement in extension.json
Added an old, but not to-outdated required version to keep a minimum
requirement

Change-Id: I7ffdf9c3246614521853c70fef6a2f0c105d7d3c
2021-12-10 13:18:23 +01:00
libraryupgrader 0c238dce47 build: Updating mediawiki/mediawiki-codesniffer to 38.0.0
Change-Id: Ic4ca68f9346bcf13083564704f183cf2e5168b3c
2021-10-24 02:10:21 +00:00
libraryupgrader f6c96a869c build: Updating dependencies
composer:
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

npm:
* ansi-regex: 5.0.0 → 5.0.1
  * https://npmjs.com/advisories/5197 (CVE-2021-3807)

Additional changes:
* composer.json: Updated phpcs command in composer test (T280592).
* composer.json: Added phpcs command to scripts (T280592).

Change-Id: I63b73115ccd5bc7539fbaa70dc60173eb827eb24
2021-10-04 17:36:49 +00:00
libraryupgrader 8742cc3df3 build: Updating path-parse to 1.0.7
* https://npmjs.com/advisories/1773 (CVE-2021-23343)

Change-Id: I88b156459f0e5ca2f16c39eef04e079a724bdc8d
2021-08-11 17:32:44 +00:00
Translation updater bot a6d599833c Localisation updates from https://translatewiki.net.
Change-Id: I4523ebefe2b393f40f88e8ed50910f1d7805baef
2021-07-30 08:27:36 +02:00
libraryupgrader 882c592e3a build: Updating mediawiki/mediawiki-codesniffer to 37.0.0
Change-Id: Iaf4798fd65d0fa85fcdbb9d59e84e3a3c7845d88
2021-07-23 19:30:16 +00:00
Translation updater bot dd126b13ba Localisation updates from https://translatewiki.net.
Change-Id: Ibb419453292b311544ee78edf3ad9a4f164dfb6e
2021-07-19 08:15:36 +02:00
libraryupgrader 7409f6988f build: Updating browserslist to 4.16.6
* https://npmjs.com/advisories/1747 (CVE-2021-23364)

Change-Id: I58c4c5d4689a12db823e758e83630b4e51660462
2021-05-25 10:44:54 +00:00
libraryupgrader 5d68c5e848 build: Updating grunt to 1.4.0
Change-Id: I2f266f3cf119a08ec3df7de7c6a17ea66a9090ee
2021-05-09 15:20:53 +00:00
libraryupgrader af10b1a524 build: Updating lodash to 4.17.21
* https://npmjs.com/advisories/1673 (CVE-2021-23337)

Change-Id: I051650ce14301c195f9fe947a6ed84b9b994f7a4
2021-05-07 20:05:31 +00:00
libraryupgrader 27c5d397e1 build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: Ife102598b57f604caf5e717cb59f5ea3e5ffbd8e
2021-05-04 03:47:06 +00:00
libraryupgrader 2d0275fd13 build: Updating eslint-config-wikimedia to 0.20.0
Change-Id: I9a16b97a16039d767524eaf75d1cf0924774e9a6
2021-04-16 10:09:29 +00:00