Skip to content

Commit 3c078ec

Browse files
author
Gavin Kistner
committed
Don't drop the end of the string when it isn't special
1 parent 7b862c5 commit 3c078ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/coderay/scanners/lua.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class CodeRay::Scanners::Lua < CodeRay::Scanners::Scanner
147147

148148
def scan_tokens(tokens, options)
149149
# We use the block form of gsub instead of the StringScanner capabilities because StringScanner does not support named captures in 1.9
150+
match = nil
150151
string.gsub(SCANNER) do
151152
match = $~
152153
tokens.text_token( match[:space], :space ) unless match[:space].empty?
@@ -176,6 +177,7 @@ def scan_tokens(tokens, options)
176177
end
177178
end
178179
end
180+
tokens.text_token(match.post_match,:content) unless match.post_match.empty?
179181
tokens
180182
end
181183

0 commit comments

Comments
 (0)