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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
cd6fc8b8
Commit
cd6fc8b8
authored
Jun 17, 2019
by
Fabio Pitino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compact syntax for default class names
parent
ad9079da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
lib/gitlab/ci/ansi2html.rb
lib/gitlab/ci/ansi2html.rb
+3
-5
spec/lib/gitlab/ci/ansi2html_spec.rb
spec/lib/gitlab/ci/ansi2html_spec.rb
+1
-1
No files found.
lib/gitlab/ci/ansi2html.rb
View file @
cd6fc8b8
...
@@ -197,9 +197,7 @@ module Gitlab
...
@@ -197,9 +197,7 @@ module Gitlab
css_classes
=
[]
css_classes
=
[]
if
@sections
.
any?
if
@sections
.
any?
css_classes
<<
"section"
css_classes
=
%w[section line]
+
sections
.
map
{
|
section
|
"s_
#{
section
}
"
}
css_classes
+=
sections
.
map
{
|
section
|
"s_
#{
section
}
"
}
css_classes
<<
"line"
end
end
write_in_tag
%{<br/>}
write_in_tag
%{<br/>}
...
@@ -217,13 +215,13 @@ module Gitlab
...
@@ -217,13 +215,13 @@ module Gitlab
normalized_section
=
section_to_class_name
(
section
)
normalized_section
=
section_to_class_name
(
section
)
if
action
==
"start"
if
action
==
"start"
handle_section_start
(
normalized_section
,
timestamp
,
line
)
handle_section_start
(
normalized_section
,
timestamp
)
elsif
action
==
"end"
elsif
action
==
"end"
handle_section_end
(
normalized_section
,
timestamp
)
handle_section_end
(
normalized_section
,
timestamp
)
end
end
end
end
def
handle_section_start
(
section
,
timestamp
,
line
)
def
handle_section_start
(
section
,
timestamp
)
return
if
@sections
.
include?
(
section
)
return
if
@sections
.
include?
(
section
)
@sections
<<
section
@sections
<<
section
...
...
spec/lib/gitlab/ci/ansi2html_spec.rb
View file @
cd6fc8b8
...
@@ -233,7 +233,7 @@ describe Gitlab::Ci::Ansi2html do
...
@@ -233,7 +233,7 @@ describe Gitlab::Ci::Ansi2html do
text
=
"
#{
section_start
}
\e
[91mHello
\e
[0m
\n
#{
section_end
}
"
text
=
"
#{
section_start
}
\e
[91mHello
\e
[0m
\n
#{
section_end
}
"
header
=
%{<span class="term-fg-l-red section js-section-header js-s-#{class_name(section_name)}">Hello</span>}
header
=
%{<span class="term-fg-l-red section js-section-header js-s-#{class_name(section_name)}">Hello</span>}
line_break
=
%{<span class="section js-section-header js-s-#{class_name(section_name)}"><br/></span>}
line_break
=
%{<span class="section js-section-header js-s-#{class_name(section_name)}"><br/></span>}
line
=
%{<span class="section
s_#{class_name(section_name)} line
"></span>}
line
=
%{<span class="section
line s_#{class_name(section_name)}
"></span>}
empty_line
=
%{<span class="section js-s-#{class_name(section_name)}"></span>}
empty_line
=
%{<span class="section js-s-#{class_name(section_name)}"></span>}
html
=
"
#{
section_start_html
}#{
header
}#{
line_break
}#{
line
}#{
empty_line
}#{
section_end_html
}
"
html
=
"
#{
section_start_html
}#{
header
}#{
line_break
}#{
line
}#{
empty_line
}#{
section_end_html
}
"
...
...
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