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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:40:28 +0300
commitb595cb0c1dec83de5bdee18284abe86614bed33b (patch)
tree8c3d4540f193c5ff98019352f554e921b3a41a72 /lib/banzai
parent2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff)
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/footnote_filter.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/banzai/filter/footnote_filter.rb b/lib/banzai/filter/footnote_filter.rb
index 537b7c80d91..f5c4b788ad8 100644
--- a/lib/banzai/filter/footnote_filter.rb
+++ b/lib/banzai/filter/footnote_filter.rb
@@ -71,7 +71,12 @@ module Banzai
private
def random_number
- @random_number ||= rand(10000)
+ # We allow overriding the randomness with a static value from GITLAB_TEST_FOOTNOTE_ID.
+ # This allows stable generation of example HTML during GLFM Snapshot Testing
+ # (https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#markdown-snapshot-testing),
+ # and reduces the need for normalization of the example HTML
+ # (https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization)
+ @random_number ||= ENV.fetch('GITLAB_TEST_FOOTNOTE_ID', rand(10000))
end
def fn_id(num)