ramnathv/knitr — comment on commit bb08d1ca76fb9c8b8817edcfade5a1a8e9b861e7
File: R/highlight.R line 0
By ramnathv:

I think there might be a bug in your parser for `brew`. Running the code you suggested returns the `brew` template unchanged. I think the issue is with the `regex` used to detect inline code. I haven't read your parsing code, but strongly suspect that setting `perl = TRUE` for you regular expressions will solve the issue.

```r
gsub("<%[=]{0,1}\\s+(.*)[\\s-]+%>", "\\1", "<%= number %>")
<%= number %>
gsub("<%[=]{0,1}\\s+(.*)[\\s-]+%>", "\\1", "<%= number %>", perl = TRUE)
"number"
```