-
Notifications
You must be signed in to change notification settings - Fork 235
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
Use of inline HTML is not currently supported #1115
Comments
Yeah, I guess the contents of EDIT: actually, it is not parsed as markdown, but it seems that we'll need to do some more escaping after the inline substitutions. Btw. why not use |
I'm not sure I remember well, but I think it had to do with having a clickable link. Does that make sense? |
This seems to work well:
The |
More minimal reprex below. So it seems that we'll have to do another round of escaping to protect the fragile tags that were potentially inserted by inline code. var <- "\\out{<span></span>}"
roxygen2::roc_proc_text(roxygen2::rd_roclet(), "
#' @name foo
#' @title `r .GlobalEnv$var`
#' @md
NULL
")
#> Warning: [<text>:3] @title Use of inline HTML is not currently supported
#> Warning: [<text>:3] @title Use of inline HTML is not currently supported
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{\out{<span></span>}}
#> \description{
#> \out{<span></span>}
#> } Created on 2020-06-15 by the reprex package (v0.3.0) |
Before this, we evaluated dynamic after the fragile tags were removed (set aside temporarily). This is problematic, because these tags were also removed from within inline code and code blocks, and more importantly, you could not reliably return fragile tags from the dynamic code. After this patch the order is this: 1. Parse the tag as markdown, find the inline code and the code blocks, execute them, substitute back the result. 2. Set aside the fragile tags, temporarily. 3. Parse as markdown again, generate Rd. 4. Put back the fragile tags. This is a breaking change in theory, however dynamic code is relatively recent, and the affected documentation is somewhat obscure, so we can probably get away with it. The potentially affected cases are: * People having dynamic code in fragile tags. E.g. #' blah \out{`r expression`} blah This will now evaluate the expression. * People generating fragile tags dynamically. E.g. as in the original post of #1115 We actually improve this use case with this patch. Closes #1115.
The lifecycle badges produce correct output but with warnings:
Needed for r-lib/lifecycle#17.
The text was updated successfully, but these errors were encountered: