yihui/knitr — Issue #100: Potential Bug: Multiple Figures in Markdown Incorrectly Interpreted
Author: ramnathv
Created: 2012-01-22 21:16:03+00:00
State: open

Here is a reproducible example

```markdown

```

It gets incorrectly rendered since the plot output and the code chunk begin backticks are on the same line.

I think the offending lines are in https://github.com/yihui/knitr/blob/master/R/hooks.R#L104-105, where an end of line needs to be added to the `sprintf` statement

```r
hook_plot_md = function(x, options) {
base = opts_knit$get('base.url')
if (is.null(base)) base = ''
sprintf('![plot of chunk %s](%s%s.%s)', options$label,
base, x[1], x[2])
}
```