summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2006-07-11 13:37:29 +0000
committermurphy <murphy@rubychan.de>2006-07-11 13:37:29 +0000
commitaf567b33a564774f49be966fc192618a89905b0c (patch)
tree2d45caeb4e31d4b671367fb68fc5b1c7c4fad640 /lib/coderay
parent72733d78f50c175380c776abebf315745d0a6268 (diff)
downloadcoderay-af567b33a564774f49be966fc192618a89905b0c.tar.gz
Fixed Plaintext scanner (crashed on empty text - ouch!!)
Added coderay_stylesheet executable (should be "coderay stylesheet css" or just "coderay sty" some day.)
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/scanners/plaintext.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/coderay/scanners/plaintext.rb b/lib/coderay/scanners/plaintext.rb
index 432745f..1cd7a8a 100644
--- a/lib/coderay/scanners/plaintext.rb
+++ b/lib/coderay/scanners/plaintext.rb
@@ -6,7 +6,8 @@ module Scanners
register_for :plaintext, :plain
def scan_tokens tokens, options
- tokens << [scan_until(/\z/), :plain]
+ text = (scan_until(/\z/) || '')
+ tokens << [text, :plain]
end
end