diff options
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | Changes.textile | 4 | ||||
-rw-r--r-- | lib/coderay/helpers/file_type.rb | 6 | ||||
-rw-r--r-- | lib/coderay/scanners/php.rb | 1 | ||||
-rw-r--r-- | lib/coderay/scanners/python.rb | 2 | ||||
-rw-r--r-- | test/unit/file_type.rb | 6 |
6 files changed, 17 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml index 7b1b91c..43e9f45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,13 @@ rvm: - 1.8.7 - 1.9.2 - 1.9.3 + - jruby-18mode + - jruby-19mode + - rbx-18mode + # - rbx-19mode # test again later - ruby-head - - rbx - - rbx-2.0 + - jruby-head - ree - - jruby branches: only: - master diff --git a/Changes.textile b/Changes.textile index 60382f5..9ac871a 100644 --- a/Changes.textile +++ b/Changes.textile @@ -4,6 +4,10 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release {{toc}} +h2. Changes in 1.0.6 + +* The CSS Scanner now highlights tokens like @url(...)@ as @:function@ instead of @:string@. [GH-13, thanks to Joel Holdbrooks] + h2. Changes in 1.0.5 Fixes: diff --git a/lib/coderay/helpers/file_type.rb b/lib/coderay/helpers/file_type.rb index 7b90918..637001b 100644 --- a/lib/coderay/helpers/file_type.rb +++ b/lib/coderay/helpers/file_type.rb @@ -90,8 +90,8 @@ module CodeRay 'gvy' => :groovy, 'h' => :c, 'haml' => :haml, - 'htm' => :page, - 'html' => :page, + 'htm' => :html, + 'html' => :html, 'html.erb' => :erb, 'java' => :java, 'js' => :java_script, @@ -120,7 +120,7 @@ module CodeRay 'sql' => :sql, # 'ss' => :scheme, 'tmproj' => :xml, - 'xhtml' => :page, + 'xhtml' => :html, 'xml' => :xml, 'yaml' => :yaml, 'yml' => :yaml, diff --git a/lib/coderay/scanners/php.rb b/lib/coderay/scanners/php.rb index dadab00..8acfff5 100644 --- a/lib/coderay/scanners/php.rb +++ b/lib/coderay/scanners/php.rb @@ -1,3 +1,4 @@ +# encoding: ASCII-8BIT module CodeRay module Scanners diff --git a/lib/coderay/scanners/python.rb b/lib/coderay/scanners/python.rb index 5e38a2c..cbdbbdb 100644 --- a/lib/coderay/scanners/python.rb +++ b/lib/coderay/scanners/python.rb @@ -61,7 +61,7 @@ module Scanners add(PREDEFINED_VARIABLES_AND_CONSTANTS, :predefined_constant). add(PREDEFINED_EXCEPTIONS, :exception) # :nodoc: - NAME = / [^\W\d] \w* /x # :nodoc: + NAME = / [[:alpha:]_] \w* /x # :nodoc: ESCAPE = / [abfnrtv\n\\'"] | x[a-fA-F0-9]{1,2} | [0-7]{1,3} /x # :nodoc: UNICODE_ESCAPE = / u[a-fA-F0-9]{4} | U[a-fA-F0-9]{8} | N\{[-\w ]+\} /x # :nodoc: diff --git a/test/unit/file_type.rb b/test/unit/file_type.rb index 607e30a..263517b 100644 --- a/test/unit/file_type.rb +++ b/test/unit/file_type.rb @@ -63,9 +63,9 @@ class FileTypeTests < Test::Unit::TestCase end def test_html - assert_equal :page, FileType['test.htm'] - assert_equal :page, FileType['test.xhtml'] - assert_equal :page, FileType['test.html.xhtml'] + assert_equal :html, FileType['test.htm'] + assert_equal :html, FileType['test.xhtml'] + assert_equal :html, FileType['test.html.xhtml'] assert_equal :erb, FileType['_form.rhtml'] assert_equal :erb, FileType['_form.html.erb'] end |