Commit 2ae837f9 authored by http://jneen.net/'s avatar http://jneen.net/

kill the nowrap option in HTMLGitlab itself

parent 7214a221
...@@ -7,8 +7,6 @@ module Rouge ...@@ -7,8 +7,6 @@ module Rouge
# Creates a new <tt>Rouge::Formatter::HTMLGitlab</tt> instance. # Creates a new <tt>Rouge::Formatter::HTMLGitlab</tt> instance.
# #
# [+nowrap+] If set to True, don't wrap the output at all, not
# even inside a <tt><pre></tt> tag (default: false).
# [+cssclass+] CSS class for the wrapping <tt><div></tt> tag # [+cssclass+] CSS class for the wrapping <tt><div></tt> tag
# (default: 'highlight'). # (default: 'highlight').
# [+linenos+] If set to 'table', output line numbers as a table # [+linenos+] If set to 'table', output line numbers as a table
...@@ -27,14 +25,12 @@ module Rouge ...@@ -27,14 +25,12 @@ module Rouge
# be changed with lineanchorsid to e.g. foo-linenumber # be changed with lineanchorsid to e.g. foo-linenumber
# (default: 'L'). # (default: 'L').
def initialize( def initialize(
nowrap: false,
cssclass: 'highlight', cssclass: 'highlight',
linenos: nil, linenos: nil,
linenostart: 1, linenostart: 1,
lineanchors: false, lineanchors: false,
lineanchorsid: 'L' lineanchorsid: 'L'
) )
@nowrap = nowrap
@cssclass = cssclass @cssclass = cssclass
@linenos = linenos @linenos = linenos
@linenostart = linenostart @linenostart = linenostart
...@@ -60,18 +56,13 @@ module Rouge ...@@ -60,18 +56,13 @@ module Rouge
def render_untableized(tokens) def render_untableized(tokens)
data = process_tokens(tokens) data = process_tokens(tokens)
html = '' wrap_lines(data[:code])
html << "<pre class=\"#{@cssclass}\"><code>" unless @nowrap
html << wrap_lines(data[:code])
html << "</code></pre>\n" unless @nowrap
html
end end
def render_tableized(tokens) def render_tableized(tokens)
data = process_tokens(tokens) data = process_tokens(tokens)
html = '' html = ''
html << "<div class=\"#{@cssclass}\">" unless @nowrap
html << '<table><tbody>' html << '<table><tbody>'
html << "<td class=\"linenos\"><pre>" html << "<td class=\"linenos\"><pre>"
html << wrap_linenos(data[:numbers]) html << wrap_linenos(data[:numbers])
...@@ -80,7 +71,6 @@ module Rouge ...@@ -80,7 +71,6 @@ module Rouge
html << wrap_lines(data[:code]) html << wrap_lines(data[:code])
html << '</code></pre></td>' html << '</code></pre></td>'
html << '</tbody></table>' html << '</tbody></table>'
html << '</div>' unless @nowrap
html html
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment