Skip to content

Parsing for % characters #879

@ha0ye

Description

@ha0ye

Can roxygen include a warning when the resulting .Rd file is mis-formatted as a result of un-escaped % characters? (which end up as comments in the .Rd format)

This sometimes produces a warning for mismatched quotes or braces (e.g. #530, #742, #786), but this doesn't always seem to be caught until R CMD CHECK.

reprex below:

library(roxygen2)

lines <- c("#' compute a percentage",
           "#' @param x the % value to use",
           "#' @export",
           "f <- function(x, y) {x / 100 * y}")

roc_proc_text(rd_roclet(), lines)
#> $f.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in RtmpcTEw4i/file6ca12af04873
#> \name{f}
#> \alias{f}
#> \title{compute a percentage}
#> \usage{
#> f(x, y)
#> }
#> \arguments{
#>   \item{x}{the % value to use}
#> }
#> \description{
#> compute a percentage
#> }

Created on 2019-07-18 by the reprex package (v0.3.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorrd ✍️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions