From 5f412cc10e91f882027c3ca0240b98dcb6c7c35f Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 24 Jul 2019 12:41:30 +0530 Subject: [PATCH 1/2] Disable line-number selection in HTMLLineTable --- lib/rouge/formatters/html_line_table.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rouge/formatters/html_line_table.rb b/lib/rouge/formatters/html_line_table.rb index 66b5838efb..1b6229651e 100644 --- a/lib/rouge/formatters/html_line_table.rb +++ b/lib/rouge/formatters/html_line_table.rb @@ -37,7 +37,9 @@ def stream(tokens, &b) token_lines(tokens) do |line_tokens| lineno += 1 buffer << %() - buffer << %() + buffer << %() buffer << %(
#{lineno}
) buffer << %(
)
           @formatter.stream(line_tokens) { |formatted| buffer << formatted }

From cb2be99faf6d5094bd7f5eebee117cfabe055c1a Mon Sep 17 00:00:00 2001
From: Ashwin Maroli 
Date: Wed, 24 Jul 2019 14:38:35 +0530
Subject: [PATCH 2/2] Update html_line_table_spec

---
 spec/formatters/html_line_table_spec.rb | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/spec/formatters/html_line_table_spec.rb b/spec/formatters/html_line_table_spec.rb
index 4d3d0b6a27..613f3dfe01 100644
--- a/spec/formatters/html_line_table_spec.rb
+++ b/spec/formatters/html_line_table_spec.rb
@@ -7,6 +7,9 @@
   let(:subject) { Rouge::Formatters::HTMLLineTable.new(formatter, options) }
 
   let(:output) { subject.format(input_stream) }
+  let(:cell_style) do
+    "-moz-user-select: none;-ms-user-select: none;-webkit-user-select: none;user-select: none;"
+  end
 
   describe 'a simple token stream' do
     let(:input_stream) { [[Token['Name'], 'foo']] }
@@ -16,7 +19,7 @@
 
-      
+      
@@ -33,23 +36,23 @@
     let(:input_stream) { [[Token['Text'], "foo\n"], [Token['Name'], "bar\n"], [Token['Text'], "foo\nbar"]] }
 
     it 'is formatted into a table-row for every newline' do
-        expected = <<-HTML
+      expected = <<-HTML
 
1
1
foo\n
- + - + - + - + @@ -80,7 +83,7 @@
1
1
foo\n
2
2
bar\n
3
3
foo\n
4
4
bar\n
- +
15
15
foobar\n