Skip to content

Commit

Permalink
fixes rstudio/htmltools#30: when HTML code is empty, do not try to ba…
Browse files Browse the repository at this point in the history
…se64 encode images
  • Loading branch information
yihui committed Aug 7, 2015
1 parent d31f8bc commit 0b61992
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
CHANGES IN markdown VERSION 0.7.8

BUG FIXES

o fixed https://github.com/rstudio/htmltools/issues/30: markdownToHTML() did
not work with empty files (thanks, @VermillionAzure)

CHANGES IN markdown VERSION 0.7.7

BUG FIXES
Expand Down
1 change: 1 addition & 0 deletions R/renderMarkdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ renderMarkdown <- function(


.b64EncodeImages <- function(html) {
if (length(html) == 0) return(html)
reg <- "<\\s*[Ii][Mm][Gg]\\s+[Ss][Rr][Cc]\\s*=\\s*[\"']([^\"']+)[\"']"
m <- gregexpr(reg, html, perl = TRUE)
if (m[[1]][1] != -1) {
Expand Down

0 comments on commit 0b61992

Please sign in to comment.