From 01f2a843602ad19716db9e17f93c943e0c71cff9 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 16 May 2017 11:29:30 +0100 Subject: 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. --- t/color.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 't') 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)Hi}); like(render('[[!color foreground="x; pwned: exploit" text="Hi"]]'), qr{(?s)Hi}); + + like(render("[[!toc ]]\n\n## [[!color foreground=red text=Important]]"), + qr{Important}); } done_testing(); -- cgit v1.2.3