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

indented \item{}{...} entries rendered incorrectly #1117

Closed
kevinushey opened this issue Aug 28, 2019 · 2 comments

Comments

@kevinushey
Copy link

commented Aug 28, 2019

Reprex:


library(usethis)
library(pkgdown)

tmp <- file.path(tempdir(), "spaces")
usethis::create_package(tmp, open = FALSE)
setwd(tmp)

content <- "
#' Title
#'
#' This is a description.
#'
#' \\describe{
#'
#' \\item{Label}{
#'
#'   This text is indented in a way pkgdown doesn't like.
#'
#' }
#'
#' }
foo <- function() {}
"

writeLines(content, "R/foo.R")
writeLines("export(foo)", "NAMESPACE")
devtools::document()
pkgdown::build_site(tmp, preview = TRUE)

Navigate to the foo reference page:

Screen Shot 2019-08-27 at 8 16 48 PM

Note the item text is rendered as c("", <text>).

@kevinushey

This comment has been minimized.

Copy link
Author

commented Aug 28, 2019

It looks like it might just be the extra newline following the item{label{ bit that causes this.

@hadley

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

Minimal reprex:

library(pkgdown)

rd2html("
\\describe{
\\item{Label}{

  This text is indented in a way pkgdown doesn't like.
}}")
#> [1] "<dl class='dl-horizontal'>"                                                                               
#> [2] "<dt>Label</dt><dd><p>c(\"\", \"  This text is indented in a way pkgdown doesn't like.\\n\")</p></dd></dl>"

Created on 2019-08-29 by the reprex package (v0.3.0)

@hadley hadley added this to the pkgdown 1.4 milestone Aug 29, 2019

@hadley hadley closed this in bdcbcda Aug 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.