diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2012-10-11 02:23:49 +0200 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2012-10-11 02:23:49 +0200 |
commit | 43ad09c3474b5ff366398c0e2454bacf9e39d394 (patch) | |
tree | 12c90b3f59dedd0cbfacb00f668c03f550acc563 | |
parent | 1f88ad0c81707c5419e93141d5acddd842f8afe7 (diff) | |
parent | 3effca8291ed4941f7b3a1c2088b50274f28aa6f (diff) | |
download | coderay-43ad09c3474b5ff366398c0e2454bacf9e39d394.tar.gz |
Merge branch 'master' into multiline-inline-diff
-rw-r--r-- | .travis.yml | 7 | ||||
-rw-r--r-- | Changes.textile | 2 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | coderay.gemspec | 5 | ||||
-rw-r--r-- | lib/coderay/encoders/html/numbering.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/html.rb | 5 | ||||
-rw-r--r-- | lib/coderay/version.rb | 2 |
7 files changed, 13 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index 614c836..63a9b0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,11 @@ rvm: - jruby-18mode - jruby-19mode - rbx-18mode - # - rbx-19mode # test again later - # - ruby-head # test again later - # - jruby-head # test again later + - rbx-19mode + # - ruby-head # test again later: RedCloth not compiling + - jruby-head - ree branches: only: - master - - stable script: "rake test" # test:scanners" diff --git a/Changes.textile b/Changes.textile index d70c303..42af2c8 100644 --- a/Changes.textile +++ b/Changes.textile @@ -7,6 +7,8 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release h2. Next Version * add @:string/:char@, remove @:regexp/:function@ color from Terminal encoder [GH #29, thanks to Kyrylo Silin] +* allow @-@ in line number anchor prefix for HTML encoder [GH #32, thanks to shurizzle] +* Fix HTML scanner: Don't crash if HTML in a diff contains a JavaScript tag. h2. Changes in 1.0.7 @@ -8,7 +8,7 @@ gemspec group :development do gem "bundler", ">= 1.0.0" gem "rake", "~> 0.9.2" - gem "RedCloth", RUBY_PLATFORM == 'java' ? "= 4.2.7" : ">= 4.0.3" + gem "RedCloth", RUBY_PLATFORM == 'java' ? ">= 4.2.7" : ">= 4.0.3" gem "term-ansicolor" gem "shoulda-context", "~> 1.0.0" if RUBY_VERSION >= '1.8.7' gem "json" unless RUBY_VERSION >= '1.9.1' diff --git a/coderay.gemspec b/coderay.gemspec index 1f88318..e686035 100644 --- a/coderay.gemspec +++ b/coderay.gemspec @@ -8,10 +8,7 @@ Gem::Specification.new do |s| if ENV['RELEASE'] s.version = CodeRay::VERSION else - # thanks to @Argorak for this solution - # revision = 134 + (`git log --oneline | wc -l`.to_i) - # s.version = "#{CodeRay::VERSION}.#{revision}rc1" - s.version = "#{CodeRay::VERSION}.rc2" + s.version = "#{CodeRay::VERSION}.rc#{ENV['RC'] || 1}" end s.authors = ['Kornelius Kalnbach'] diff --git a/lib/coderay/encoders/html/numbering.rb b/lib/coderay/encoders/html/numbering.rb index 8bc6259..e717429 100644 --- a/lib/coderay/encoders/html/numbering.rb +++ b/lib/coderay/encoders/html/numbering.rb @@ -17,7 +17,7 @@ module Encoders anchor_prefix = options[:line_number_anchors] anchor_prefix = 'line' if anchor_prefix == true - anchor_prefix = anchor_prefix.to_s[/\w+/] if anchor_prefix + anchor_prefix = anchor_prefix.to_s[/[\w-]+/] if anchor_prefix anchoring = if anchor_prefix proc do |line| diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb index 733dd6f..49c346d 100644 --- a/lib/coderay/scanners/html.rb +++ b/lib/coderay/scanners/html.rb @@ -69,6 +69,7 @@ module Scanners def setup @state = :initial @plain_string_content = nil + @in_tag = nil end def scan_java_script encoder, code @@ -83,7 +84,8 @@ module Scanners def scan_tokens encoder, options state = options[:state] || @state plain_string_content = @plain_string_content - in_tag = in_attribute = nil + in_tag = @in_tag + in_attribute = nil encoder.begin_group :string if state == :attribute_value_string @@ -237,6 +239,7 @@ module Scanners if options[:keep_state] @state = state @plain_string_content = plain_string_content + @in_tag = in_tag end encoder.end_group :string if state == :attribute_value_string diff --git a/lib/coderay/version.rb b/lib/coderay/version.rb index 620e703..87d1cff 100644 --- a/lib/coderay/version.rb +++ b/lib/coderay/version.rb @@ -1,3 +1,3 @@ module CodeRay - VERSION = '1.0.7' + VERSION = '1.0.8' end |