Skip to content

Commit b845854

Browse files
author
hornik
committed
Note percentages in image height/width attributes (v.Nu complains about these).
git-svn-id: https://svn.r-project.org/R/trunk@88961 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent d84daa4 commit b845854

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/library/tools/R/RdConv2.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,17 @@ checkRd <- function(Rd, defines = .Platform$OS.type, stages = "render",
912912
"\\deqn" =,
913913
"\\figure" = {
914914
checkContent(block[[1L]], tag)
915-
if (length(block) > 1L) checkContent(block[[2L]], tag)
915+
if(length(block) > 1L) {
916+
checkContent(block[[2L]], tag)
917+
if(length(txt <- as.character(block[[2L]])) &&
918+
startsWith(txt[1L], "options: ")) {
919+
txt <- grepv("(height|width) *= *['\"]?[[:digit:]]+%",
920+
paste(txt, collapse = "\n"))
921+
if(length(txt))
922+
warnRd(block, Rdfile, level = -1,
923+
"height/width attributes should be in pixels")
924+
}
925+
}
916926
},
917927
"\\tabular" = checkTabular(block),
918928
"\\subsection" = {

0 commit comments

Comments
 (0)