summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-05-18 10:25:59 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-18 10:25:59 +0000
commitc0e77f7c9cc24104981bb8f6973ceeb9c311e1e2 (patch)
tree54402d82ae262b212613408c011477e664ace0d3 /lib/banzai
parent9f863dbe1a5ed324b7fb202eea11397d1fcdd61f (diff)
downloadgitlab-ce-c0e77f7c9cc24104981bb8f6973ceeb9c311e1e2.tar.gz
Resolve "Expand API: Render an arbitrary Markdown document"
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/reference_filter.rb2
-rw-r--r--lib/banzai/pipeline/gfm_pipeline.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/banzai/filter/reference_filter.rb b/lib/banzai/filter/reference_filter.rb
index b9d5ecf70ec..2f023f4f242 100644
--- a/lib/banzai/filter/reference_filter.rb
+++ b/lib/banzai/filter/reference_filter.rb
@@ -73,7 +73,7 @@ module Banzai
#
# Note that while the key might exist, its value could be nil!
def validate
- needs :project
+ needs :project unless skip_project_check?
end
# Iterates over all <a> and text() nodes in a document.
diff --git a/lib/banzai/pipeline/gfm_pipeline.rb b/lib/banzai/pipeline/gfm_pipeline.rb
index 8b2f05fffec..a1f24e8b093 100644
--- a/lib/banzai/pipeline/gfm_pipeline.rb
+++ b/lib/banzai/pipeline/gfm_pipeline.rb
@@ -42,9 +42,9 @@ module Banzai
end
def self.transform_context(context)
- context.merge(
- only_path: true,
+ context[:only_path] = true unless context.key?(:only_path)
+ context.merge(
# EmojiFilter
asset_host: Gitlab::Application.config.asset_host,
asset_root: Gitlab.config.gitlab.base_url