summaryrefslogtreecommitdiff
path: root/lib/coderay
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2011-03-07 23:27:00 +0000
committermurphy <murphy@rubychan.de>2011-03-07 23:27:00 +0000
commitd6ac35558a92d23d6b12b3dda4d14ca10693f4ec (patch)
tree96e1f19019b0df187837327b17da5d55814428e4 /lib/coderay
parent37eedf77a09ea2bfc034735f173438cea24bb0a2 (diff)
downloadcoderay-d6ac35558a92d23d6b12b3dda4d14ca10693f4ec.tar.gz
highlight multiline JS blocks as :inline group
Diffstat (limited to 'lib/coderay')
-rw-r--r--lib/coderay/scanners/html.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb
index 7cc9c9c..1c0eecf 100644
--- a/lib/coderay/scanners/html.rb
+++ b/lib/coderay/scanners/html.rb
@@ -88,7 +88,11 @@ module Scanners
code = scan_until(/(?=(?:\n\s*)?<\/script>)|\z/)
closing = false
end
- scan_java_script encoder, code
+ unless code.empty?
+ encoder.begin_group :inline
+ scan_java_script encoder, code
+ encoder.end_group :inline
+ end
encoder.text_token closing, :comment if closing
end
next if eos?