Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
2ae837f9
Commit
2ae837f9
authored
Jun 15, 2016
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kill the nowrap option in HTMLGitlab itself
parent
7214a221
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
11 deletions
+1
-11
lib/rouge/formatters/html_gitlab.rb
lib/rouge/formatters/html_gitlab.rb
+1
-11
No files found.
lib/rouge/formatters/html_gitlab.rb
View file @
2ae837f9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment