Skip to content

Commit c3321ae

Browse files
committed
strip fig-anonymous identifers in post filter
1 parent e4ce71e commit c3321ae

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-- fig-cleanup.lua
2+
-- Copyright (C) 2021 by RStudio, PBC
3+
4+
5+
local function stripFigAnonymous(el)
6+
if isAnonymousFigId(el.attr.identifier) then
7+
el.attr.identifier = ""
8+
return el
9+
end
10+
end
11+
12+
function figCleanup()
13+
return {
14+
Div = stripFigAnonymous,
15+
Image = stripFigAnonymous
16+
}
17+
end
18+
19+

src/resources/filters/quarto-post/quarto-post.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import("responsive.lua")
1919
import("latexdiv.lua")
2020
import("foldcode.lua")
2121
import("book-cleanup.lua")
22+
import("fig-cleanup.lua")
2223
import("ipynb.lua")
2324
import("ojs.lua")
2425
import("reveal.lua")
@@ -48,7 +49,8 @@ return {
4849
ipynb(),
4950
reveal(),
5051
tikz(),
51-
delink()
52+
delink(),
53+
figCleanup()
5254
}),
5355
ojs(),
5456
quartoPostMetaInject(),

0 commit comments

Comments
 (0)