Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-16 15:44:50 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-12-16 15:44:50 +0300
commit40104746d6418b54cd80726d77c05e85cf2ddbb3 (patch)
treeaaa9bd256a8fefc7fb9dfcbe123dc869550dfb71 /lib/banzai
parent5ffed49fef07a06f46f7e4e3511d7f6b9f378892 (diff)
parent907209821590efc34b11b60a042c6554bd11897f (diff)
Merge remote-tracking branch 'origin/feature/update-rubocop'
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/markdown_filter.rb2
-rw-r--r--lib/banzai/filter/table_of_contents_filter.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/filter/markdown_filter.rb b/lib/banzai/filter/markdown_filter.rb
index 0072bab1f99..d09cf41df39 100644
--- a/lib/banzai/filter/markdown_filter.rb
+++ b/lib/banzai/filter/markdown_filter.rb
@@ -6,7 +6,7 @@ module Banzai
class MarkdownFilter < HTML::Pipeline::TextFilter
def initialize(text, context = nil, result = nil)
super text, context, result
- @text = @text.gsub "\r", ''
+ @text = @text.delete "\r"
end
def call
diff --git a/lib/banzai/filter/table_of_contents_filter.rb b/lib/banzai/filter/table_of_contents_filter.rb
index 92d130074dc..9b3e67206d5 100644
--- a/lib/banzai/filter/table_of_contents_filter.rb
+++ b/lib/banzai/filter/table_of_contents_filter.rb
@@ -31,7 +31,7 @@ module Banzai
id = text.downcase
id.gsub!(PUNCTUATION_REGEXP, '') # remove punctuation
- id.gsub!(' ', '-') # replace spaces with dash
+ id.tr!(' ', '-') # replace spaces with dash
id.squeeze!('-') # replace multiple dashes with one
uniq = (headers[id] > 0) ? "-#{headers[id]}" : ''