mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Description2
synced 2024-11-23 22:33:34 +00:00
c146909532
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
51 lines
1.1 KiB
JSON
51 lines
1.1 KiB
JSON
{
|
|
"name": "Description2",
|
|
"version": "0.4.1",
|
|
"author": [
|
|
"[http://danf.ca/mw/ Daniel Friesen]"
|
|
],
|
|
"url": "https://www.mediawiki.org/wiki/Extension:Description2",
|
|
"descriptionmsg": "description2-desc",
|
|
"license-name": "GPL-2.0-or-later",
|
|
"type": "other",
|
|
"requires": {
|
|
"MediaWiki": ">= 1.35.0"
|
|
},
|
|
"config": {
|
|
"EnableMetaDescriptionFunctions": false,
|
|
"DescriptionMaxChars": 300
|
|
},
|
|
"ConfigRegistry": {
|
|
"Description2": "GlobalVarConfig::newInstance"
|
|
},
|
|
"ServiceWiringFiles": [
|
|
"includes/ServiceWiring.php"
|
|
],
|
|
"AutoloadNamespaces": {
|
|
"MediaWiki\\Extension\\Description2\\": "includes/"
|
|
},
|
|
"ExtensionMessagesFiles": {
|
|
"Description2Magic": "Description2.i18n.magic.php"
|
|
},
|
|
"MessagesDirs": {
|
|
"Description2": [
|
|
"i18n"
|
|
]
|
|
},
|
|
"HookHandlers": {
|
|
"Description2": {
|
|
"class": "MediaWiki\\Extension\\Description2\\Hooks",
|
|
"services": [
|
|
"ConfigFactory",
|
|
"Description2.DescriptionProvider"
|
|
]
|
|
}
|
|
},
|
|
"Hooks": {
|
|
"OutputPageParserOutput": "Description2",
|
|
"ParserAfterTidy": "Description2",
|
|
"ParserFirstCallInit": "Description2"
|
|
},
|
|
"manifest_version": 1
|
|
}
|