Go to file
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
i18n Localisation updates from https://translatewiki.net. 2024-01-30 09:38:55 +01:00
includes Truncate descriptions to a certain length 2024-02-24 08:44:53 +01:00
.eslintrc.json build: Updating eslint-config-wikimedia to 0.19.0 2021-03-13 10:26:43 +00:00
.gitignore build: Replace jsonlint with eslint 2021-02-15 20:27:55 +01:00
.gitreview Whoops, track not trace 2016-10-24 17:02:25 -07:00
.phpcs.xml build: Updating mediawiki/mediawiki-codesniffer to 20.0.0 2018-05-26 01:57:25 +00:00
CODE_OF_CONDUCT.md build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 2018-09-03 01:19:53 +00:00
composer.json build: Updating mediawiki/mediawiki-codesniffer to 41.0.0 2023-03-12 00:41:07 +00:00
Description2.i18n.magic.php Add composer for CI, and fix CS errors 2017-12-22 08:01:33 +00:00
extension.json Truncate descriptions to a certain length 2024-02-24 08:44:53 +01:00
Gruntfile.js build: Replace jsonlint with eslint 2021-02-15 20:27:55 +01:00
package-lock.json build: Updating grunt-banana-checker to 0.11.1 2024-02-10 08:38:23 +00:00
package.json build: Updating grunt-banana-checker to 0.11.1 2024-02-10 08:38:23 +00:00