diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-01 15:51:27 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-01 15:53:32 +0100 |
commit | f3ea06eb7f8bef748be0882cb0b4fb58deed8eef (patch) | |
tree | 42e9620a2ec0234ce20778ae40d781c2504254e8 /spec/support | |
parent | 62c14ba2edf9ac4b4bb1e8c46c0c60f1b6574909 (diff) | |
download | gitlab-ce-f3ea06eb7f8bef748be0882cb0b4fb58deed8eef.tar.gz |
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.rb | 19 |
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 |