diff options
author | Fabio Pitino <fpitino@gitlab.com> | 2019-06-14 10:20:18 +0100 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-06-14 15:43:43 +0100 |
commit | ad96cc0ed7d6b02e3dd175cba8e2179d73a47e69 (patch) | |
tree | 4a174dc22192f8e411384fc3210283b7052174ae /lib/gitlab/ci/ansi2html.rb | |
parent | cb0616fe01729cd0f2be02b16a87407a87144300 (diff) | |
download | gitlab-ce-ad96cc0ed7d6b02e3dd175cba8e2179d73a47e69.tar.gz |
Fixing specs
Diffstat (limited to 'lib/gitlab/ci/ansi2html.rb')
-rw-r--r-- | lib/gitlab/ci/ansi2html.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb index 7f98cfa4f79..083041397dc 100644 --- a/lib/gitlab/ci/ansi2html.rb +++ b/lib/gitlab/ci/ansi2html.rb @@ -187,6 +187,10 @@ module Gitlab ) end + def section_to_class_name(section) + section.to_s.downcase.gsub(/[^a-z0-9]/, '-') + end + def handle_new_line css_classes = [] @@ -208,8 +212,7 @@ module Gitlab section = scanner[3] line = scanner.matched[0...-5] # strips \r\033[0K - # generate section class - normalized_section = section.to_s.downcase.gsub(/[^a-z0-9]/, '-') + normalized_section = section_to_class_name(section) if action == "start" handle_section_start(normalized_section, timestamp, line) |