From 504a048b0824aecb81faa3ca4a9503a05c93faac Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Wed, 15 Jun 2016 12:08:04 -0700 Subject: remove the dead linenos and linenostart options and the methods that relied on them --- lib/rouge/formatters/html_gitlab.rb | 46 ++----------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) (limited to 'lib/rouge') diff --git a/lib/rouge/formatters/html_gitlab.rb b/lib/rouge/formatters/html_gitlab.rb index 04943c173bd..b76021eef77 100644 --- a/lib/rouge/formatters/html_gitlab.rb +++ b/lib/rouge/formatters/html_gitlab.rb @@ -9,14 +9,6 @@ module Rouge # # [+cssclass+] CSS class for the wrapping
tag # (default: 'highlight'). - # [+linenos+] If set to 'table', output line numbers as a table - # with two cells, one containing the line numbers, - # the other the whole code. This is copy paste friendly, - # but may cause alignment problems with some browsers - # or fonts. If set to 'inline', the line numbers will - # be integrated in the
 tag that contains
-      #                     the code (default: nil).
-      # [+linenostart+]     The line number for the first line (default: 1).
       # [+lineanchors+]     If set to true the formatter will wrap each output
       #                     line in an anchor tag with a name of L-linenumber.
       #                     This allows easy linking to certain lines
@@ -26,53 +18,23 @@ module Rouge
       #                     (default: 'L').
       def initialize(
           cssclass: 'highlight',
-          linenos: nil,
-          linenostart: 1,
           lineanchors: false,
           lineanchorsid: 'L'
       )
         @cssclass = cssclass
-        @linenos = linenos
-        @linenostart = linenostart
         @lineanchors = lineanchors
         @lineanchorsid = lineanchorsid
       end
 
       def render(tokens)
-        case @linenos
-        when 'table'
-          render_tableized(tokens)
-        when 'inline'
-          render_untableized(tokens)
-        else
-          render_untableized(tokens)
-        end
-      end
-
-      alias_method :format, :render
-
-      private
-
-      def render_untableized(tokens)
         data = process_tokens(tokens)
 
         wrap_lines(data[:code])
       end
 
-      def render_tableized(tokens)
-        data = process_tokens(tokens)
+      alias_method :format, :render
 
-        html = ''
-        html << ''
-        html << "'
-        html << "'
-        html << '
"
-        html << wrap_linenos(data[:numbers])
-        html << '
"
-        html << wrap_lines(data[:code])
-        html << '
' - html - end + private def process_tokens(tokens) rendered = [] @@ -101,10 +63,6 @@ module Rouge { numbers: numbers, code: rendered } end - def wrap_linenos(numbers) - numbers.join("\n") - end - def wrap_lines(lines) if @lineanchors lines = lines.each_with_index.map do |line, index| -- cgit v1.2.3