Debian Codegraph @

tests/fig_path.R

raw
1 src = '
2 ---
3 output:
4 html:
5 options:
6 embed_resources: false
7 ---
8
9 ```{r}
10 plot(1)
11 ```
12 '
13
14 old = litedown::reactor(fig.path = 'foo')
15 out = litedown::fuse(text = src, output = 'markdown')
16 stopifnot('![](<foochunk-1-1.png>)' %in% unlist(strsplit(out, '\n')))
17 unlink('foochunk-1-1.png')
18
19 litedown::reactor(fig.path = 'foo/bar')
20 out = litedown::fuse(text = src, output = 'markdown')
21 stopifnot('![](<foo/barchunk-1-1.png>)' %in% unlist(strsplit(out, '\n')))
22 unlink('foo', recursive = TRUE)
23
24 litedown::reactor(old)