diff options
-rw-r--r-- | Changes.textile | 1 | ||||
-rwxr-xr-x | lib/coderay/token_kinds.rb | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/Changes.textile b/Changes.textile index 48c723e..2d599b7 100644 --- a/Changes.textile +++ b/Changes.textile @@ -21,6 +21,7 @@ h3. @Tokens::AbbreviationForKind@ See "#122":http://redmine.rubychan.de/issues/122. * *REMOVED* token kinds @:attribute_name_fat@, @:attribute_value_fat@, @:operator_fat@, @:tag_fat@, and @:xml_text@. * *ADDED* token kind @:filename@. +* *CHANGED*: Don't raise error for unknown token kinds unless in @$CODERAY_DEBUG@ mode. h3. @Encoders::CommentFilter@ diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb index c8e370c..29bacb4 100755 --- a/lib/coderay/token_kinds.rb +++ b/lib/coderay/token_kinds.rb @@ -1,7 +1,11 @@ module CodeRay class Tokens AbbreviationForKind = Hash.new do |h, k| # :nodoc: - raise 'Undefined Token kind: %p' % [k] # :nodoc: + if $CODERAY_DEBUG + raise 'Undefined Token kind: %p' % [k] # :nodoc: + else + :NO_HIGHLIGHT + end end AbbreviationForKind.update with = { # :nodoc: :annotation => 'at', |