aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-05-16 11:29:30 +0100
committerSimon McVittie <smcv@debian.org>2017-05-16 12:08:55 +0100
commit01f2a843602ad19716db9e17f93c943e0c71cff9 (patch)
tree7d891eaeda20ed40cd3dc76bfe3fd7adf5bd0fdc /t
parent49de9594b71159d2a1755c80a096f1886b5fb05c (diff)
downloadikiwiki-01f2a843602ad19716db9e17f93c943e0c71cff9.tar
ikiwiki-01f2a843602ad19716db9e17f93c943e0c71cff9.tar.gz
color: Use markup for the preserved CSS, not character data
This still smuggles it past the sanitize step, but avoids having other plugins that want to capture text content without markup (notably toc) see the CSS as if it was text content.
Diffstat (limited to 't')
-rwxr-xr-xt/color.t7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/color.t b/t/color.t
index c5c14f6aa..dca0d865c 100755
--- a/t/color.t
+++ b/t/color.t
@@ -25,10 +25,10 @@ sub render {
foreach my $scrub (0, 1) {
if ($scrub) {
- $config{add_plugins}=[qw(color htmlscrubber)];
+ $config{add_plugins}=[qw(color htmlscrubber toc)];
}
else {
- $config{add_plugins}=[qw(color)];
+ $config{add_plugins}=[qw(color toc)];
}
IkiWiki::loadplugins();
@@ -44,6 +44,9 @@ foreach my $scrub (0, 1) {
qr{(?s)<span class="color" style="">Hi</span>});
like(render('[[!color foreground="x; pwned: exploit" text="Hi"]]'),
qr{(?s)<span class="color" style="">Hi</span>});
+
+ like(render("[[!toc ]]\n\n## [[!color foreground=red text=Important]]"),
+ qr{<a href="\#index1h2">Important</a>});
}
done_testing();