Skip to content

Commit

Permalink
fix #1289: allow whitespaces before % in Rtex code chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Sep 15, 2016
1 parent 8ff41c5 commit 8e9c7fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/pattern.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ all_patterns = list(

`tex` = list(
chunk.begin = '^\\s*%+\\s*begin.rcode\\s*(.*)', chunk.end = '^\\s*%+\\s*end.rcode',
chunk.code = '^%+', ref.chunk = '^%+\\s*<<(.+)>>\\s*$',
chunk.code = '^\\s*%+', ref.chunk = '^%+\\s*<<(.+)>>\\s*$',
inline.comment = '^\\s*%.*', inline.code = '\\\\rinline\\{([^}]+)\\}',
header.begin = '(^|\n)\\s*\\\\documentclass[^}]+\\}',
document.begin = '\\s*\\\\begin\\{document\\}'),
Expand All @@ -35,7 +35,7 @@ all_patterns = list(

`rst` = list(
chunk.begin = '^\\s*[.][.]\\s+\\{r(.*)\\}\\s*$',
chunk.end = '^\\s*[.][.]\\s+[.][.]\\s*$', chunk.code = '^[.][.]',
chunk.end = '^\\s*[.][.]\\s+[.][.]\\s*$', chunk.code = '^\\s*[.][.]',
ref.chunk = '^\\.*\\s*<<(.+)>>\\s*$', inline.code = ':r:`([^`]+)`'),

`asciidoc` = list(
Expand Down

0 comments on commit 8e9c7fc

Please sign in to comment.