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

Escaping [, ] character outside of code blocks is buggy in markdown mode #720

Closed
mb706 opened this issue Mar 4, 2018 · 1 comment
Closed
Labels
bug an unexpected problem or unintended behavior markdown ⬇️

Comments

@mb706
Copy link

mb706 commented Mar 4, 2018

Trying to escape [ characters outside of code blocks generates broken .Rd files.

Examples (in the description block, but the bug occurs in other blocks as well):

#' \[ test \] description

generates

\description{
[ test ] description

[ test ]: R:%20test%20%5C
}

A way around this is currently to only escape the beginning [ character:

#' \[ test ] description

to get

\description{
[ test ] description
}

However, I have not found a way to put a link between escaped brackets (without resorting to \link):

#' \[ [test] ] description

gives (also when escaping both outer [ and ]):

\description{
[ [test] ] description

[ [test]: R:%20[test
}
@gaborcsardi
Copy link
Member

gaborcsardi commented Mar 4, 2018

Reproducible example:

roc <- rd_roclet()
out1 <- roc_proc_text(roc, "
  #' Title
  #'
  #' \\[ test \\] description
  #' @md
  foo <- function() {}")[[1]]
out1
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in RtmpZ0IFGm/file125e27337212c
#> \name{foo}
#> \alias{foo}
#> \title{Title}
#> \usage{
#> foo()
#> }
#> \description{
#> [ test ] description [ test ]: R:%20test%20%5C
#> }

@hadley hadley added bug an unexpected problem or unintended behavior markdown ⬇️ labels Jun 28, 2018
@hadley hadley closed this as completed in 9bcefb6 Jun 28, 2018
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 markdown ⬇️
Projects
None yet
Development

No branches or pull requests

3 participants