fix(export): emit one CSS class per keyword for independent colouring
All keywords previously shared `class="todo"`, so a stylesheet couldn't distinguish e.g. red TODO from green DONE. Emit a distinct class per keyword (todo/done/started/fixme/fixed/xxx); TODO keeps the vimwiki `todo` class so stock vimwiki CSS still styles it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -196,8 +196,20 @@ fn inline_code_is_escaped() {
|
||||
|
||||
#[test]
|
||||
fn keyword_spans() {
|
||||
let out = render("TODO write tests\n");
|
||||
assert!(out.contains("<span class=\"keyword keyword-todo\">TODO</span>"));
|
||||
// One class per keyword so a stylesheet can colour groups differently.
|
||||
// TODO keeps the vimwiki `todo` class.
|
||||
let cases = [
|
||||
("TODO x\n", "<span class=\"todo\">TODO</span>"),
|
||||
("DONE x\n", "<span class=\"done\">DONE</span>"),
|
||||
("STARTED x\n", "<span class=\"started\">STARTED</span>"),
|
||||
("FIXME x\n", "<span class=\"fixme\">FIXME</span>"),
|
||||
("FIXED x\n", "<span class=\"fixed\">FIXED</span>"),
|
||||
("XXX x\n", "<span class=\"xxx\">XXX</span>"),
|
||||
];
|
||||
for (src, expected) in cases {
|
||||
let out = render(src);
|
||||
assert!(out.contains(expected), "src {src:?} -> {out}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user