Skip to content

Double backslashes in examples render differently with 7.0.1 #990

@wch

Description

@wch

I'm actually not sure if this is intentional or not. But in roxygen2 <= 7.0.0, given this input in the examples section:

#' "\\alpha" \\

It would produce this output:

"\\\\alpha" \\\\

In 7.0.1, it produces this:

"\\alpha" \\

Reprex (note that there are extra backslashes in the input for escaping):

library(roxygen2)
roc_proc_text(rd_roclet(), "
#' Example
#' @examples
#' \"\\\\alpha\" \\\\
f <- function() {}
")
#> $f.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{f}
#> \alias{f}
#> \title{Example}
#> \usage{
#> f()
#> }
#> \description{
#> Example
#> }
#> \examples{
#> "\\alpha" \\
#> }

For a real-life example, the upgrade to 7.0.1 resulted in this change, which led to a R CMD check failure:

rstudio/shiny@0cbe4bb#diff-fd9eb6354a4cc65e5016dd2dd015e7d4R20

If this is the intended behavior, then that's fine; we can change the .R files to match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions