diff options
author | Simon McVittie <smcv@debian.org> | 2017-05-16 11:29:30 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2017-05-16 12:08:55 +0100 |
commit | 01f2a843602ad19716db9e17f93c943e0c71cff9 (patch) | |
tree | 7d891eaeda20ed40cd3dc76bfe3fd7adf5bd0fdc /t | |
parent | 49de9594b71159d2a1755c80a096f1886b5fb05c (diff) | |
download | ikiwiki-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-x | t/color.t | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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(); |