Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown code blocks with class rmd in roxygen2 documentation end up empty #2298

Closed
salim-b opened this issue Apr 14, 2023 · 0 comments · Fixed by #2300
Closed

Markdown code blocks with class rmd in roxygen2 documentation end up empty #2298

salim-b opened this issue Apr 14, 2023 · 0 comments · Fixed by #2300
Labels
bug an unexpected problem or unintended behavior

Comments

@salim-b
Copy link
Collaborator

salim-b commented Apr 14, 2023

roxygen2 allows to write "fenced" Markdown code blocks, optionally with a source code language identifier like md. Such a code block results in .Rd content like

\if{html}{\out{<div class="sourceCode md">}}\preformatted{
CODE BLOCK CONTENT
}\if{html}{\out{</div>}}

But if one specifies the language identifier rmd for a code block, pkgdown silently omits the block's content in the generated HTML.

Try to render the following .R file content to reproduce the issue (and change rmd to md to make pkgdown not omit the Can you see me? block content):

#' Test
#'
#' ``` rmd
#' Can you see me?
#' ```
#'
#' @export
test <- function() {
  "test"
}

I believe this to be a regression somewhere between pkgdown 2.0.6 and 2.0.7, maybe related to changes around #2092.

salim-b added a commit to rpkg-dev/pkgpurl that referenced this issue Apr 14, 2023
@maelle maelle added the bug an unexpected problem or unintended behavior label Apr 21, 2023
hadley pushed a commit that referenced this issue Oct 19, 2023
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants