まず、Quarto はデフォルトでコード ブロック出力を tag. To get the output asis you need to use the chunk option results: asis.
Secondly, sprintf (or even print) returns output enclosed within quotes. So after using results: asis, you would get the html tags but would also get the quotes. So you need to wrap the sprintf with cat to get intended results.
---
format: html
---
```{r}
#| echo: false
imageLink %s", iUrl, iText))
}
```
```{r}
#| echo: false
#| results: asis
imageLink("https://www.united.com/8cd8323f017505df6908afc0b72b4925.svg", "united logo")
```
and now, here's what it's supposed to look like:
united logo
注意すべき点が 2 つあります:
まず、Quarto はデフォルトでコード ブロック出力を
tag. To get the output asis you need to use the chunk option
results: asis
.Secondly,
sprintf
(or evenprint
) returns output enclosed within quotes. So after usingresults: asis
, you would get the html tags but would also get the quotes. So you need to wrap thesprintf
withcat
to get intended results.