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:
authorDouwe Maan <douwe@gitlab.com>2015-12-01 17:51:27 +0300
committerDouwe Maan <douwe@gitlab.com>2015-12-01 17:53:32 +0300
commitf3ea06eb7f8bef748be0882cb0b4fb58deed8eef (patch)
tree42e9620a2ec0234ce20778ae40d781c2504254e8 /spec/support
parent62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909 (diff)
Autolink first so we don't pick up numeric anchors as issue references.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/filter_spec_helper.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/support/filter_spec_helper.rb b/spec/support/filter_spec_helper.rb
index 97e5c270a59..91e3bee13c1 100644
--- a/spec/support/filter_spec_helper.rb
+++ b/spec/support/filter_spec_helper.rb
@@ -35,11 +35,24 @@ module FilterSpecHelper
pipeline.call(body)
end
- def reference_pipeline_result(body, contexts = {})
+ def reference_pipeline(contexts = {})
contexts.reverse_merge!(project: project) if defined?(project)
- pipeline = HTML::Pipeline.new([described_class, Gitlab::Markdown::ReferenceGathererFilter], contexts)
- pipeline.call(body)
+ filters = [
+ Gitlab::Markdown::AutolinkFilter,
+ described_class,
+ Gitlab::Markdown::ReferenceGathererFilter
+ ]
+
+ HTML::Pipeline.new(filters, contexts)
+ end
+
+ def reference_pipeline_result(body, contexts = {})
+ reference_pipeline(contexts).call(body)
+ end
+
+ def reference_filter(html, contexts = {})
+ reference_pipeline(contexts).to_document(html)
end
# Modify a String reference to make it invalid