From 7994b599387006342dce53ad513a4eb567b77ef9 Mon Sep 17 00:00:00 2001 From: Yu Cong Date: Mon, 13 Oct 2025 00:57:43 +0800 Subject: [PATCH] fix duplicate labels --- filter.lua | 4 +++- output.html | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/filter.lua b/filter.lua index ea255a0..7fbf2ec 100644 --- a/filter.lua +++ b/filter.lua @@ -135,7 +135,9 @@ local function collect_node(doc, l) } for _, t in ipairs(targets) do if nodes[t] then - table.insert(blocks, nodes[t]:clone()) + local cl = nodes[t]:clone() + cl.identifier = "" + table.insert(blocks, cl) -- show("insert [" .. nodes[t].identifier .. ']\n') else io.stderr:write("Cannot find AST node with label " .. t .. "\n") diff --git a/output.html b/output.html index 102d986..1636cf0 100644 --- a/output.html +++ b/output.html @@ -4,10 +4,10 @@

thm2 - inthm2 (need thm1)

-
+

test thm2

-
+

test thm1

something

@@ -15,7 +15,7 @@
-
+

test thm1

something

@@ -31,7 +31,7 @@

test thm2

-
+

test thm1

something