summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/html.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-09-22 01:12:24 +0000
committermurphy <murphy@rubychan.de>2010-09-22 01:12:24 +0000
commit275febc7a310a4826adbe98458a5a0c4dc3eca12 (patch)
treeabb4416ed697063ff6aab3385aae8b8fb1e09903 /lib/coderay/encoders/html.rb
parentc1ec72d1ea5a4f150802fa3b8b42f850d0479882 (diff)
downloadcoderay-275febc7a310a4826adbe98458a5a0c4dc3eca12.tar.gz
Fixed line token classes when using hints.
Diffstat (limited to 'lib/coderay/encoders/html.rb')
-rw-r--r--lib/coderay/encoders/html.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index c59ee03..6e57855 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -271,7 +271,11 @@ module Encoders
# whole lines to be highlighted, eg. a deleted line in a diff
def begin_line kind
if style = @css_style[@last_opened ? [kind, *@opened] : kind]
- @out << style.sub('<span class="', '<span class="line ')
+ if style['class="']
+ @out << style.sub('class="', 'class="line ')
+ else
+ @out << style.sub('>', ' class="line">')
+ end
else
@out << '<span class="line">'
end