mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateStyles
synced 2024-11-14 19:31:38 +00:00
1c0687c850
For example, <templatestyles wrapper="a[href]" /> fails with an InvalidArgumentException very late in the process, long after the actual validation in TemplateStylesHooks::validateExtraWrapper() was done. This happens because validateExtraWrapper() works on a proper tree (where the [href] from the example is a nested object), but flattens this tree in the end via toTokenArray(). This flattened array ends in StyleRuleSanitizer::doSanitize() where it is added to a ComponentValueList – which expects a tree. The only change in this patch is that the object structure is not flattened any more. That's all. Bug: T258093 Change-Id: I5dc04611f91fe672da706f31fa8d0c254e3123d3 |
||
---|---|---|
.phan | ||
i18n | ||
includes | ||
tests/phpunit | ||
.eslintrc.json | ||
.gitignore | ||
.gitreview | ||
.phpcs.xml | ||
CODE_OF_CONDUCT.md | ||
composer.json | ||
COPYING | ||
extension.json | ||
Gruntfile.js | ||
hooks.txt | ||
package-lock.json | ||
package.json | ||
README.md |
TemplateStyles
The TemplateStyles extension introduces a <templatestyles>
tag to specify that a stylesheet should be loaded from a wiki page. Placing this in a template allows the template to have custom styles without having to place them in MediaWiki:Common.css.
For installation and setup instructions, see https://www.mediawiki.org/wiki/Extension:TemplateStyles.
For instructions on how to use the extension as an editor on a wiki, see https://www.mediawiki.org/wiki/Help:TemplateStyles.