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:
Diffstat (limited to 'app/helpers/gitlab_markdown_helper.rb')
-rw-r--r--app/helpers/gitlab_markdown_helper.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 6cad5e4658e..69425bc171d 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -35,7 +35,6 @@ module GitlabMarkdownHelper
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
filter_html: true,
with_toc_data: true,
- hard_wrap: true,
safe_links_only: true
}.merge(options))
@markdown = Redcarpet::Markdown.new(gitlab_renderer,
@@ -45,7 +44,7 @@ module GitlabMarkdownHelper
fenced_code_blocks: true,
autolink: true,
strikethrough: true,
- lax_html_blocks: true,
+ lax_spacing: true,
space_after_headers: true,
superscript: true)
end
@@ -64,8 +63,7 @@ module GitlabMarkdownHelper
# project_path_with_namespace - namespace/projectname, eg. gitlabhq/gitlabhq
# ref - name of the branch or reference, eg. stable
# requested_path - path of request, eg. doc/api/README.md, used in special case when path is pointing to the .md file were the original request is coming from
- # wiki - whether the markdown is from wiki or not
- def create_relative_links(text, project, ref, requested_path, wiki = false)
+ def create_relative_links(text, project, ref, requested_path)
@path_to_satellite = project.satellite.path
project_path_with_namespace = project.path_with_namespace
paths = extract_paths(text)
@@ -135,12 +133,12 @@ module GitlabMarkdownHelper
end
# Checks if the path exists in the repo
- # eg. checks if doc/README.md exists, if it doesn't then it is a wiki link
+ # eg. checks if doc/README.md exists, if not then link to blob
def path_with_ref(path, ref)
if file_exists?(path)
"#{local_path(path)}/#{correct_ref(ref)}"
else
- "wikis"
+ "blob/#{correct_ref(ref)}"
end
end