Pandoc’s fenced Div blocks in Hugo Academic theme do not work

I am not sure if this is the right place to ask my question. If it is not, please advise me where to ask.

I have problems using fenced divs with blogdown Academic theme explained in R Markdown Cookbook. It works in a new installation of blogdown with Xmin, as I tested. But in the Academic theme, whenever I save, the curly brake gets protected by a backslash.

So the sample code

::: {#hello .greeting .message width="40%"}
Hello **world**!


::: {\#hello .greeting .message width="40%"} Hello **world**! :::

As it works with a new installation of a minimal Hugo theme, I assume it has to do with the theme. But where to look?

(I ran all the check functions and have set goldmark:renderer:unsafe to yes. blogdown.method = 'html' and I am working with an .Rmd file.)

I am using macOS 11.3.1, Hugo 0.82.0, R 4.1.0, blogdown 1.3, rmarkdown 2.8, wowchemy (Academic) 5.1.0

This may or may not be helpful, but I just spent >24hr troubleshooting what may be a similar problem on a cluster so I'll share:

For me documents rendered fine via RStudio Server, but not from the R CLI. Fenced divs were the biggest issue.

My problem came down to pandoc version - I discovered RStudio (Server?) sets an environment variable that directs knitting to an bundled pandoc executable. My problem was solved by prepending the path to the newer version of pandoc into my PATH variable on the command line.

Is it possible your Hugo project has cached environment variables which don't include a reference to a suitable pandoc version?

Thank you @sturu for sharing your experiences. I am using the same pandoc/Hugo installation with the Xmin Hugo theme where fenced divs do work. So I don't think that the problem is related to the pandoc version.

Hi @petzi53,

I can't reproduce on a new academic blogdown site. Using the template, I add the fenced div and when I knit it renders correct in the resulting HTML file contains in the post folder.

When you say the fenced div "becomes", you mean in the resulting HTML file ?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.