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

Brackets multiple lines apart can match each other #1195

Closed
DavisVaughan opened this issue Jan 29, 2021 · 6 comments
Closed

Brackets multiple lines apart can match each other #1195

DavisVaughan opened this issue Jan 29, 2021 · 6 comments

Comments

@DavisVaughan
Copy link
Member

With the following chunk of documentation, the [ seems to be matching the ] a few lines down, resulting in garbled output

#' My docs
#'
#' @description
#' Hello `[closed, open)`.
#'
#' Hello again `(open, closed]`.
#'
#' @name interval
NULL

Screen Shot 2021-01-29 at 1 48 09 PM

The generated man file:

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/time-point.R
\name{interval}
\alias{interval}
\title{My docs}
\description{
Hello \verb{[closed, open)}.

Hello again \verb{(open, closed]}.

[closed, open)`.

Hello again `(open, closed]: R:closed,\%20open)\%60.\%0A\%0AHello\%20again\%20\%60(open,\%20closed
}
@DavisVaughan
Copy link
Member Author

Possibly related to #720?

I was just able to "fix" it with:

#' My docs
#'
#' @description
#' Hello \[closed, open).
#'
#' Hello again (open, closed].
#'
#' @name interval
NULL

@gaborcsardi
Copy link
Member

It is best to write these kind of strings in non-markdown mode. Otherwise the markdown parser with interpret the brackets.

@DavisVaughan
Copy link
Member Author

How do I turn off markdown mode to just write that string?

@DavisVaughan
Copy link
Member Author

Oh maybe this? It seems to work for me

#' My docs
#'
#' @description
#' Hello \code{[closed, open)}.
#'
#' Hello again \code{(open, closed]}.
#'
#' @name interval
NULL

@gaborcsardi
Copy link
Member

Yeah, \code{} is perfect for a short piece of text, or @noMd turns it off for a chunk.

@DavisVaughan
Copy link
Member Author

Thanks!

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

No branches or pull requests

2 participants