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
path: root/lib
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2021-06-08 18:21:12 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2021-06-08 18:21:12 +0300
commit405d0c191bed769d9d00eff263b85f9a9b6820a5 (patch)
treef8b75587ce50e58ca8fcdeb32bdb96fdc6ffb48f /lib
parentc0d0fdbd442e048dbede48e6b3275aabe4796f63 (diff)
Expand the introduced in filter to be more flexible
Basically, let us add any text we want between (introduced|(re)moved|deprecated) and (in|to).
Diffstat (limited to 'lib')
-rw-r--r--lib/filters/introduced_in.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/filters/introduced_in.rb b/lib/filters/introduced_in.rb
index fcd62a56..aed35eae 100644
--- a/lib/filters/introduced_in.rb
+++ b/lib/filters/introduced_in.rb
@@ -10,12 +10,12 @@ class IntroducedInFilter < Nanoc::Filter
doc.css('blockquote').each do |blockquote|
content = blockquote.inner_html
# Searches for a blockquote with either:
- # - "introduced in"
- # - "removed in"
- # - "deprecated in"
- # - "moved to"
+ # - "introduced <optional text> in"
+ # - "removed <optional text> in"
+ # - "deprecated <optional text> in"
+ # - "moved <optional text> to"
# ...followed by "GitLab"
- next if content !~ /(<a href="[^"]+">)?(introduced|(re)?moved|deprecated)(<\/a>)? (in|to).*GitLab/mi
+ next if content !~ /(<a href="[^"]+">)?(introduced|(re)?moved|deprecated)(<\/a>)?(.*)? (in|to).*GitLab/mi
new_content = generate(content)
blockquote.replace(new_content)