Commit a14d109b authored by Robert Speicher's avatar Robert Speicher

Provide autoload paths for filters to prevent circular dependency

parent b71e5a17
...@@ -29,6 +29,17 @@ module Gitlab ...@@ -29,6 +29,17 @@ module Gitlab
# >> gfm(":trollface:") # >> gfm(":trollface:")
# => "<img alt=\":trollface:\" class=\"emoji\" src=\"/images/trollface.png" title=\":trollface:\" /> # => "<img alt=\":trollface:\" class=\"emoji\" src=\"/images/trollface.png" title=\":trollface:\" />
module Markdown module Markdown
# Provide autoload paths for filters to prevent a circular dependency error
autoload :CommitRangeReferenceFilter, 'gitlab/markdown/commit_range_reference_filter'
autoload :CommitReferenceFilter, 'gitlab/markdown/commit_reference_filter'
autoload :EmojiFilter, 'gitlab/markdown/emoji_filter'
autoload :ExternalIssueReferenceFilter, 'gitlab/markdown/external_issue_reference_filter'
autoload :IssueReferenceFilter, 'gitlab/markdown/issue_reference_filter'
autoload :LabelReferenceFilter, 'gitlab/markdown/label_reference_filter'
autoload :MergeRequestReferenceFilter, 'gitlab/markdown/merge_request_reference_filter'
autoload :SnippetReferenceFilter, 'gitlab/markdown/snippet_reference_filter'
autoload :UserReferenceFilter, 'gitlab/markdown/user_reference_filter'
# Public: Parse the provided text with GitLab-Flavored Markdown # Public: Parse the provided text with GitLab-Flavored Markdown
# #
# text - the source text # text - the source text
...@@ -64,11 +75,11 @@ module Gitlab ...@@ -64,11 +75,11 @@ module Gitlab
context = { context = {
# SanitizationFilter # SanitizationFilter
whitelist: sanitization_whitelist, whitelist: sanitization_whitelist,
# EmojiFilter # EmojiFilter
asset_root: Gitlab.config.gitlab.url, asset_root: Gitlab.config.gitlab.url,
asset_host: Gitlab::Application.config.asset_host, asset_host: Gitlab::Application.config.asset_host,
# ReferenceFilter # ReferenceFilter
current_user: current_user, current_user: current_user,
......
...@@ -20,7 +20,7 @@ module Gitlab ...@@ -20,7 +20,7 @@ module Gitlab
other = Project.find_with_namespace(ref) other = Project.find_with_namespace(ref)
return nil unless other && user_can_reference_project?(other) return nil unless other && user_can_reference_project?(other)
other other
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment