summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2017-11-02 23:16:14 +0100
committerKornelius Kalnbach <murphy@rubychan.de>2017-11-02 23:16:14 +0100
commit1f2367aead6b76f694041cb2688652ed70ae215a (patch)
tree2753212c91c93d61afa2d12aac85d5b3a873e52b /lib/coderay
parent1bdaeef6c43436e4984f5b96cb17618f82832225 (diff)
parente15cf96405177153e1418496a7a8e85beaa679fb (diff)
downloadcoderay-1f2367aead6b76f694041cb2688652ed70ae215a.tar.gz
Merge branch 'master' into dsl
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/encoders/encoder.rb2
-rw-r--r--lib/coderay/encoders/html.rb4
-rw-r--r--lib/coderay/scanners/haml.rb2
-rw-r--r--lib/coderay/scanners/java.rb2
-rw-r--r--[-rwxr-xr-x]lib/coderay/token_kinds.rb0
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/coderay/encoders/encoder.rb b/lib/coderay/encoders/encoder.rb
index fa5695d..2baeedb 100644
--- a/lib/coderay/encoders/encoder.rb
+++ b/lib/coderay/encoders/encoder.rb
@@ -146,7 +146,7 @@ module CodeRay
end
def get_output options
- options[:out] || ''
+ options[:out] || ''.dup
end
# Append data.to_s to the output. Returns the argument.
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index 0365022..5d55b00 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -161,7 +161,7 @@ module Encoders
if options[:wrap] || options[:line_numbers]
@real_out = @out
- @out = ''
+ @out = ''.dup
end
@break_lines = (options[:break_lines] == true)
@@ -297,7 +297,7 @@ module Encoders
end
def break_lines text, style
- reopen = ''
+ reopen = ''.dup
@opened.each_with_index do |kind, index|
reopen << (@span_for_kinds[index > 0 ? [kind, *@opened[0...index]] : kind] || '<span>')
end
diff --git a/lib/coderay/scanners/haml.rb b/lib/coderay/scanners/haml.rb
index 5433790..d516ba9 100644
--- a/lib/coderay/scanners/haml.rb
+++ b/lib/coderay/scanners/haml.rb
@@ -75,7 +75,7 @@ module Scanners
tag = false
- if match = scan(/%[\w:]+\/?/)
+ if match = scan(/%[-\w:]+\/?/)
encoder.text_token match, :tag
# if match = scan(/( +)(.+)/)
# encoder.text_token self[1], :space
diff --git a/lib/coderay/scanners/java.rb b/lib/coderay/scanners/java.rb
index 962154e..982a796 100644
--- a/lib/coderay/scanners/java.rb
+++ b/lib/coderay/scanners/java.rb
@@ -44,7 +44,7 @@ module Scanners
'"' => /[^\\"]+/,
'/' => /[^\\\/]+/,
} # :nodoc:
- IDENT = /[a-zA-Z_][A-Za-z_0-9]*/ # :nodoc:
+ IDENT = RUBY_VERSION < '1.9' ? /[a-zA-Z_][A-Za-z_0-9]*/ : Regexp.new('[[[:alpha:]]_][[[:alnum:]]_]*') # :nodoc:
protected
diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb
index f911862..f911862 100755..100644
--- a/lib/coderay/token_kinds.rb
+++ b/lib/coderay/token_kinds.rb