From d6ac35558a92d23d6b12b3dda4d14ca10693f4ec Mon Sep 17 00:00:00 2001 From: murphy Date: Mon, 7 Mar 2011 23:27:00 +0000 Subject: highlight multiline JS blocks as :inline group --- lib/coderay/scanners/html.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/coderay') 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? -- cgit v1.2.1