summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2011-06-22 07:22:23 +0000
committermurphy <murphy@rubychan.de>2011-06-22 07:22:23 +0000
commitd6fe4e777a4f543c8828dbf77e955ab38e6c2803 (patch)
tree7f2a155c7645718f8936e649aee05574cd3d1b54 /lib/coderay/scanners/ruby
parent90f70ee61e87e137aa192c5db97c382e1ec7d24b (diff)
downloadcoderay-d6fe4e777a4f543c8828dbf77e955ab38e6c2803.tar.gz
#309 Improved highlighting of Ruby inside diffs
Diffstat (limited to 'lib/coderay/scanners/ruby')
-rw-r--r--lib/coderay/scanners/ruby/string_state.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/coderay/scanners/ruby/string_state.rb b/lib/coderay/scanners/ruby/string_state.rb
index 14127c6..2f398d1 100644
--- a/lib/coderay/scanners/ruby/string_state.rb
+++ b/lib/coderay/scanners/ruby/string_state.rb
@@ -55,7 +55,7 @@ module Scanners
def heredoc_pattern delim, interpreted, indented
# delim = delim.dup # workaround for old Ruby
delim_pattern = Regexp.escape(delim)
- delim_pattern = / \n #{ '(?>[ \t]*)' if indented } #{ Regexp.new delim_pattern } $ /x
+ delim_pattern = / (?:\A|\n) #{ '(?>[ \t]*)' if indented } #{ Regexp.new delim_pattern } $ /x
if interpreted
/ (?= #{delim_pattern}() | \\ | \# [{$@] ) /mx # $1 set == end of heredoc
else