r79833 src/library/tools/R/Rd2HTML.R minor typo

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

r79833 src/library/tools/R/Rd2HTML.R minor typo

Ivan Krylov
On line 105, "&\\hellip;" should probably be "…":

Index: Rd2HTML.R
===================================================================
--- Rd2HTML.R   (revision 79833)
+++ Rd2HTML.R   (working copy)
@@ -102,7 +102,7 @@
     ## http://htmlhelp.com/reference/html40/entities/symbols.html
     if(inEqn) {
         x <- psub("\\\\(Alpha|Beta|Gamma|Delta|Epsilon|Zeta|Eta|Theta|Iota|Kappa|Lambda|Mu|Nu|Xi|Omicron|Pi|Rho|Sigma|Tau|Upsilon|Phi|Chi|Psi|Omega|alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|le|ge|sum|prod)", "&\\1;",
x)
-        x <- psub("\\\\(dots|ldots)", "&\\hellip;", x)
+        x <- psub("\\\\(dots|ldots)", "&hellip;", x)
         x <- fsub("\\infty", "&infin;", x)
         x <- fsub("\\sqrt", "&radic;", x)
     }

The backslash is ignored by gsub(), so no actual bug happens as a
result of this.

Further checking with

w <- makeCodeWalker(
 call = function(e,w) {
  if (
   grepl('^[gpf]?sub$', as.character(e[[1]])) &&
   grepl('\\', as.character(e[[3]]), fixed=TRUE)
  ) print(e) else lapply(e, walkCode, w)
 }, leaf = function(.,..) invisible()
)
for (f in list.files(
 'R-devel/src/library/tools/R',
 full = TRUE, pattern = '\\.R$', ignore.case=TRUE
)) for (e in parse(f)) invisible(walkCode(e, w))

doesn't reveal any similar typos.

--
Best regards,
Ivan

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: r79833 src/library/tools/R/Rd2HTML.R minor typo

Martin Maechler
Thank you, Ivan,

I've updated the source now,
Martin

> On line 105, "&\\hellip;" should probably be "&hellip;":
> Index: Rd2HTML.R
> ===================================================================
> --- Rd2HTML.R   (revision 79833)
> +++ Rd2HTML.R   (working copy)
>
>
> -        x <- psub("\\\\(dots|ldots)", "&\\hellip;", x)
> +        x <- psub("\\\\(dots|ldots)", "&hellip;", x)
>
>
> The backslash is ignored by gsub(), so no actual bug happens as a
> result of this.
>
> [............]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel