Skip to content

Commit 9f9a3bc

Browse files
committed
fix: open single quote
1 parent 621c01a commit 9f9a3bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/coderay/scanners/bash.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def scan_tokens encoder, options
106106
@shell = (not @shell)
107107
encoder.text_token(match, :delimiter)
108108
next
109-
elsif match = scan(/'[^']*'/)
109+
elsif match = scan(/'[^']*'?/)
110110
kind = :string
111111
elsif match = scan(/(?: \& | > | < | \| >> | << | >\& )/ox)
112112
kind = :bin
@@ -222,6 +222,10 @@ def scan_tokens encoder, options
222222
encoder.text_token(match, kind)
223223
end
224224

225+
if @state == :quote
226+
encoder.end_group :string
227+
end
228+
225229
encoder
226230
end
227231

0 commit comments

Comments
 (0)