From 594190312ca8adc4b783394273dc982f9f57b98f Mon Sep 17 00:00:00 2001 From: Kyle Bock Date: Thu, 18 Oct 2012 13:19:05 -0400 Subject: [PATCH 1/3] added logic for double clicking to show line numbers only if line numbers are hidden in table mode --- lib/coderay/encoders/html/output.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/coderay/encoders/html/output.rb b/lib/coderay/encoders/html/output.rb index 9132d94c..5a374e32 100644 --- a/lib/coderay/encoders/html/output.rb +++ b/lib/coderay/encoders/html/output.rb @@ -125,7 +125,7 @@ def apply target, replacement TABLE = Template.new <<-TABLE - +
<%LINE_NUMBERS%>
<%CONTENT%>
<%CONTENT%>
TABLE From 58025b7f8982e67128223c3e76014b3e626885e6 Mon Sep 17 00:00:00 2001 From: Kyle Bock Date: Fri, 19 Oct 2012 10:16:33 -0400 Subject: [PATCH 2/3] fixed tests related to pull request --- test/functional/examples.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/examples.rb b/test/functional/examples.rb index ff64af31..d99b47e3 100755 --- a/test/functional/examples.rb +++ b/test/functional/examples.rb @@ -26,7 +26,7 @@ def test_examples 2 3 -
5.times do
+  
5.times do
   puts 'Hello, world!'
 end
@@ -40,7 +40,7 @@ def test_examples - +
 
puts "Hello, world!"
puts "Hello, world!"
From d141844db003dbec25d5b2e4a8d06094e064aa0a Mon Sep 17 00:00:00 2001 From: Kyle Bock Date: Fri, 19 Oct 2012 11:56:07 -0400 Subject: [PATCH 3/3] Modified the regular expresion in test/executable/suite.rb to pass for other attributes added to the class="code" table cell. could you please review this regular expression to make sure it is correct. in my testing everything seemed to work correctly. --- test/executable/suite.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/executable/suite.rb b/test/executable/suite.rb index f3495d61..3f8d6c0d 100644 --- a/test/executable/suite.rb +++ b/test/executable/suite.rb @@ -114,7 +114,7 @@ def coderay args, options = {} source = File.read source_file - pre = %r{
(.*?)
}m + pre = %r{
(.*?)<\/pre>}m
     tag = /<[^>]*>/
     
     should 'not throw an error' do
@@ -169,7 +169,7 @@ def coderay args, options = {}
     
     source = File.read source_file
     
-    pre = %r{
(.*?)
}m + pre = %r{
(.*?)
}m tag_class = /]*>/ should 'respect the file extension and highlight the input as Python' do @@ -184,7 +184,7 @@ def coderay args, options = {} source = File.read source_file - pre = %r{
(.*?)
}m + pre = %r{
(.*?)
}m tag_class = /]*>/ should 'ignore the file extension and highlight the input as Ruby' do