Go to file
Thiemo Kreuz 1c0687c850 Fix wrapper="…" failing for more complex selectors
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
2020-10-15 06:51:21 +00:00
.phan Add phan 2019-05-01 16:06:46 +02:00
i18n Localisation updates from https://translatewiki.net. 2020-08-24 11:59:14 +02:00
includes Fix wrapper="…" failing for more complex selectors 2020-10-15 06:51:21 +00:00
tests/phpunit Fix wrapper="…" failing for more complex selectors 2020-10-15 06:51:21 +00:00
.eslintrc.json Use json extension for .eslintrc 2019-06-07 21:19:59 +02:00
.gitignore build: Updating eslint-utils to 1.4.2 2019-08-23 06:34:52 +00:00
.gitreview Whoops, track not trace 2016-10-24 17:03:54 -07:00
.phpcs.xml build: Updating mediawiki/mediawiki-codesniffer to 17.0.0 2018-03-29 06:09:06 +00:00
CODE_OF_CONDUCT.md build: Updating mediawiki/phan-taint-check-plugin to 1.4.0 2018-09-01 14:41:18 +00:00
composer.json build: Updating mediawiki/minus-x to 1.1.0 2020-06-10 08:09:13 +00:00
COPYING Use wikimedia/css-sanitizer, and rewrite the hooking 2017-06-07 15:14:09 +00:00
extension.json Use RevisionRecordCallback in ParserOptions, require MW 1.35+ 2020-06-03 03:12:20 +00:00
Gruntfile.js build: Use existing eslint also for json linting 2020-09-11 23:49:03 +02:00
hooks.txt Use wikimedia/css-sanitizer, and rewrite the hooking 2017-06-07 15:14:09 +00:00
package-lock.json build: Use existing eslint also for json linting 2020-09-11 23:49:03 +02:00
package.json build: Use existing eslint also for json linting 2020-09-11 23:49:03 +02:00
README.md Add a README 2020-04-30 11:44:33 -04:00

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.