diff --git a/static/ui.js b/static/ui.js index cd25232e..0d8949b4 100644 --- a/static/ui.js +++ b/static/ui.js @@ -7829,7 +7829,7 @@ function renderMd(raw){ if(listStack[depth]) listStack.pop(); listStack[depth]=openList(depth,ordered); } - const item={value,content:[content],sublists:[]}; + const item={ordered,value,content:[content],sublists:[]}; listStack[depth].items.push(item); itemStack[depth]=item; for(let k=itemStack.length-1;k>depth;k--) itemStack.pop(); diff --git a/tests/test_renderer_js_behaviour.py b/tests/test_renderer_js_behaviour.py index 9c3c587a..4ae347c9 100644 --- a/tests/test_renderer_js_behaviour.py +++ b/tests/test_renderer_js_behaviour.py @@ -420,6 +420,20 @@ class TestMixedNestedLists: ) in out, out assert "</li>" not in out, out + def test_ordered_item_with_task_marker_keeps_literal_prefix(self, driver_path): + """Task-list rendering applies only to unordered items: an ordered + item whose text starts with [x]/[ ] must keep its literal prefix + (e.g. '1. [x] shipped') instead of being silently converted to a + ✅/☐ task icon (review fix for #6700: openItem() dropped `ordered` + from the item constructor, so every item looked unordered).""" + out = _render(driver_path, "1. [x] shipped\n2. [ ] pending") + assert 'class="task-done"' not in out, out + assert 'class="task-todo"' not in out, out + assert "✅" not in out, out + assert "☐" not in out, out + assert '