You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, regenerate the ./man/plot.Validation.Rd file via, e.g., devtools::document(). Then, parse the .Rd file to HTML via tools::Rd2HTML("./man/plot.Validation.Rd"). The HTML output looks like this (i.e., indentation preserved):
<!-- ... --><p>Example of a validation plot:
</p><divstyle="text-align: center"><p><imgsrc="../help/figures/example-validation.png" style="width: 640px; max-width: 90%;" alt="Example Validation" /></div></p><!-- ... -->
Note that the empty line below the #' Example of a validation plot: line confuses the parser, which closes the <p> tag. Also, according to HTML semantics it is not valid to have block-level content between <p>...</p>.
The problem seems to go away by removing the empty line mentioned above, which will result in the following HTML:
<!-- ... --><p>Example of a validation plot:
<divstyle="text-align: center"><imgsrc="../help/figures/example-validation.png" style="width: 640px; max-width: 90%;" alt="Example Validation" /></div></p><!-- ... -->
The text was updated successfully, but these errors were encountered:
This does not solve the issue. The tidy utility (i.e., html-tidy.org) still produces a warning when ran against the following HTML:
<!DOCTYPE html><htmllang="en"><head><title>Test</title></head><body><p>
Example of a validation plot:
<divstyle="text-align: center"><imgsrc="../help/figures/example-validation.png" style="width: 640px; max-width: 90%;" alt="Example Validation" /></div></p></body></html>
Namely:
line 12 column 5 - Warning: inserting implicit <p>
The same can be observed from the online HTML validator at validator.w3.org, which produces:
The issue seems due to placing a div element inside the p element. This is not allowed since it is not semantically correct.
One way around this is to replace:
<p>
Example of a validation plot:
<divstyle="text-align: center"><imgsrc="../help/figures/example-validation.png" style="width: 640px; max-width: 90%;" alt="Example Validation" /></div></p>
with:
<p>
Example of a validation plot:
<spanstyle="display: block; text-align: center;"><imgsrc="../help/figures/example-validation.png" style="width: 640px; max-width: 90%;" alt="Example Validation" /></span></p>
Upon submitting to CRAN, the following
NOTE
was produced:The issue seems to be with the
\if{html}{...}
parts in the documentation.Take, for example, the following code (i.e., at 7e068a9) in file
plot-Validation.R
:powerly/man-roxygen/plot-Validation.R
Lines 37 to 43 in 7e068a9
First, regenerate the
./man/plot.Validation.Rd
file via, e.g.,devtools::document()
. Then, parse the.Rd
file toHTML
viatools::Rd2HTML("./man/plot.Validation.Rd")
. TheHTML
output looks like this (i.e., indentation preserved):Note that the empty line below the
#' Example of a validation plot:
line confuses the parser, which closes the<p>
tag. Also, according toHTML
semantics it is not valid to have block-level content between<p>...</p>
.The problem seems to go away by removing the empty line mentioned above, which will result in the following
HTML
:The text was updated successfully, but these errors were encountered: