From c9d6e77ab9cbc9cf001ab370d4da8a7ec8f77a8d Mon Sep 17 00:00:00 2001 From: shura Date: Tue, 28 Aug 2012 06:08:02 +0300 Subject: Update lib/coderay/encoders/html/numbering.rb --- lib/coderay/encoders/html/numbering.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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| -- cgit v1.2.1 From f5bb55cc14cc17bc4665347fe6c2e11145101624 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 7 Oct 2012 02:59:02 +0200 Subject: Fix HTML scanner: Don't crash if HTML in a diff contains a JavaScript tag. --- Changes.textile | 1 + lib/coderay/scanners/html.rb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changes.textile b/Changes.textile index d70c303..3326a71 100644 --- a/Changes.textile +++ b/Changes.textile @@ -7,6 +7,7 @@ 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] +* Fix HTML scanner: Don't crash if HTML in a diff contains a JavaScript tag. h2. Changes in 1.0.7 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 -- cgit v1.2.1 From 0ab69bf775106de1954a54a492d0df778f1d15ad Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 7 Oct 2012 02:59:14 +0200 Subject: update changelog --- Changes.textile | 1 + 1 file changed, 1 insertion(+) diff --git a/Changes.textile b/Changes.textile index 3326a71..42af2c8 100644 --- a/Changes.textile +++ b/Changes.textile @@ -7,6 +7,7 @@ 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 -- cgit v1.2.1 From f3dcecb9b875a816aa10b3e24aee25aa7347fd58 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 7 Oct 2012 03:11:15 +0200 Subject: bump version to 1.0.8 --- lib/coderay/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1 From 8c8f5a6b64211e1480edbab1eeb9f7bb76d60ecc Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 7 Oct 2012 03:13:54 +0200 Subject: cleaning up RC release script --- coderay.gemspec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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'] -- cgit v1.2.1 From 0081a2af728b19834309f6d60d33383de56f6026 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 7 Oct 2012 12:49:27 +0200 Subject: testing more Ruby versions with Travis --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 614c836..9ec759e 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 # test again later + - ruby-head # test again later + - jruby-head # test again later - ree branches: only: - master - - stable script: "rake test" # test:scanners" -- cgit v1.2.1 From 3effca8291ed4941f7b3a1c2088b50274f28aa6f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 7 Oct 2012 13:48:36 +0200 Subject: ruby-head does not work because of RedCloth, remove it from Travis config --- .travis.yml | 6 +++--- Gemfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9ec759e..63a9b0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,9 @@ 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: diff --git a/Gemfile b/Gemfile index 80fe57c..aa03288 100644 --- a/Gemfile +++ b/Gemfile @@ -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' -- cgit v1.2.1