diff options
author | murphy <murphy@rubychan.de> | 2011-03-07 23:27:00 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2011-03-07 23:27:00 +0000 |
commit | d6ac35558a92d23d6b12b3dda4d14ca10693f4ec (patch) | |
tree | 96e1f19019b0df187837327b17da5d55814428e4 | |
parent | 37eedf77a09ea2bfc034735f173438cea24bb0a2 (diff) | |
download | coderay-d6ac35558a92d23d6b12b3dda4d14ca10693f4ec.tar.gz |
highlight multiline JS blocks as :inline group
-rw-r--r-- | lib/coderay/scanners/html.rb | 6 |
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? |