summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-06-15 11:58:47 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-07-14 10:08:14 -0700
commit2ae837f9c9c62272efae4f6dbb1d33cbba325389 (patch)
tree40961e1d3aa16e72bbc13f42e80f8e18be148955
parent7214a221e082c569b4804eb4729e097d4e4b069c (diff)
downloadgitlab-ce-2ae837f9c9c62272efae4f6dbb1d33cbba325389.tar.gz
kill the nowrap option in HTMLGitlab itself
-rw-r--r--lib/rouge/formatters/html_gitlab.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/rouge/formatters/html_gitlab.rb b/lib/rouge/formatters/html_gitlab.rb
index 50b1db88c0e..04943c173bd 100644
--- a/lib/rouge/formatters/html_gitlab.rb
+++ b/lib/rouge/formatters/html_gitlab.rb
@@ -7,8 +7,6 @@ module Rouge
# 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
# (default: 'highlight').
# [+linenos+] If set to 'table', output line numbers as a table
@@ -27,14 +25,12 @@ module Rouge
# be changed with lineanchorsid to e.g. foo-linenumber
# (default: 'L').
def initialize(
- nowrap: false,
cssclass: 'highlight',
linenos: nil,
linenostart: 1,
lineanchors: false,
lineanchorsid: 'L'
)
- @nowrap = nowrap
@cssclass = cssclass
@linenos = linenos
@linenostart = linenostart
@@ -60,18 +56,13 @@ module Rouge
def render_untableized(tokens)
data = process_tokens(tokens)
- html = ''
- html << "<pre class=\"#{@cssclass}\"><code>" unless @nowrap
- html << wrap_lines(data[:code])
- html << "</code></pre>\n" unless @nowrap
- html
+ wrap_lines(data[:code])
end
def render_tableized(tokens)
data = process_tokens(tokens)
html = ''
- html << "<div class=\"#{@cssclass}\">" unless @nowrap
html << '<table><tbody>'
html << "<td class=\"linenos\"><pre>"
html << wrap_linenos(data[:numbers])
@@ -80,7 +71,6 @@ module Rouge
html << wrap_lines(data[:code])
html << '</code></pre></td>'
html << '</tbody></table>'
- html << '</div>' unless @nowrap
html
end