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

Comments

@mb706
Copy link

@mb706 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
Collaborator

@gaborcsardi 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
#> }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants