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

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2021-06-18 05:09:59 +0300
committerEvan Read <eread@gitlab.com>2021-06-18 05:09:59 +0300
commit32133e84ae8474629c6fcaaca2ff7536d79e0745 (patch)
treeb80c4a8126696a4e0948e0be23961bf7dbb8cb7c
parent73e001bb62a3f7fe9a973c7ddde42cfe58105491 (diff)
Simplify regex to catch moreeread/enhance-version-information-feature
-rw-r--r--lib/filters/introduced_in.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/filters/introduced_in.rb b/lib/filters/introduced_in.rb
index acf6ec1b..4ede0b4a 100644
--- a/lib/filters/introduced_in.rb
+++ b/lib/filters/introduced_in.rb
@@ -9,20 +9,8 @@ class IntroducedInFilter < Nanoc::Filter
doc = Nokogiri::HTML.fragment(content.dup)
doc.css('blockquote').each do |blockquote|
content = blockquote.inner_html
- # Searches for a blockquote with either of the following:
- #
- # - Specific strings:
- # - "introduced <optional text> in"
- # - "removed <optional text> in"
- # - "deprecated <optional text> in"
- # - "moved <optional text> to"
- # ...followed by "GitLab"
- #
- # - The presense of "**(VERSION_INFO)**" or "- **(VERSION_INFO)**"
+ next if content !~ %r{(<a href="[^"]+">)?(</a>)?(.*)?}
- next unless content =~ %r{(<a href="[^"]+">)?(introduced|(re)?moved|deprecated)(</a>)?(.*)? (in|to).*GitLab}mi || content =~ %r{(<li>)?<strong>\(VERSION_INFO\)</strong>(</li>)?}mi
-
- content.gsub!(%r{(<li>)?<strong>\(VERSION_INFO\)</strong>(</li>)?}, "")
new_content = generate(content)
blockquote.replace(new_content)
end