summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/encoders')
-rw-r--r--lib/coderay/encoders/html.rb5
-rw-r--r--lib/coderay/encoders/html/classes.rb1
-rw-r--r--lib/coderay/encoders/html/output.rb2
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/coderay/encoders/html.rb b/lib/coderay/encoders/html.rb
index 11fa84c..0b43c0c 100644
--- a/lib/coderay/encoders/html.rb
+++ b/lib/coderay/encoders/html.rb
@@ -205,6 +205,7 @@ module Encoders
def finish options
not_needed = @opened.shift
@out << '</span>' * @opened.size
+ warn '%d tokens still open' % @opened.size unless @opened.empty?
@out.extend Output
@out.css = @css
@@ -230,11 +231,11 @@ module Encoders
case text
when :open
@opened[0] = type
- @out << @css_style[@opened]
+ @out << (@css_style[@opened] || '<span>')
@opened << type
when :close
unless @opened.empty?
- raise 'Not Token to be closed.' unless @opened.size > 1
+ raise 'Malformed token stream: Trying to close a token that was never opened.' unless @opened.size > 1
@out << '</span>'
@opened.pop
end
diff --git a/lib/coderay/encoders/html/classes.rb b/lib/coderay/encoders/html/classes.rb
index 4a01920..3d40a42 100644
--- a/lib/coderay/encoders/html/classes.rb
+++ b/lib/coderay/encoders/html/classes.rb
@@ -20,6 +20,7 @@ module CodeRay module Encoders
:directive => 'di',
:doc => 'do',
:doc_string => 'ds',
+ :entity => 'en',
:error => 'er',
:escape => 'e',
:exception => 'ex',
diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb
index 80ab4f1..e9a3a41 100644
--- a/lib/coderay/encoders/html/output.rb
+++ b/lib/coderay/encoders/html/output.rb
@@ -174,7 +174,7 @@ module CodeRay
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
<head>
- <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CodeRay HTML Encoder Example</title>
<style type="text/css">
<%CSS%>