diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-10 18:30:02 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-10 18:31:07 +0200 |
commit | 0ece6bd82839d0c9e3e27b65a6a201771f09190e (patch) | |
tree | 40c877c8377f2bcad111de9e3bdf0daabdb0c3a3 /app/helpers/gitlab_markdown_helper.rb | |
parent | 6cf7dd625a7db143c146de1b146cba7dbcbc2576 (diff) | |
download | gitlab-ce-0ece6bd82839d0c9e3e27b65a6a201771f09190e.tar.gz |
Use `\A` and `\z` in regexes instead of `^` and `$`.
Diffstat (limited to 'app/helpers/gitlab_markdown_helper.rb')
-rw-r--r-- | app/helpers/gitlab_markdown_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index 17266656a4e..aa1de2f50ef 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -13,7 +13,7 @@ module GitlabMarkdownHelper def link_to_gfm(body, url, html_options = {}) return "" if body.blank? - escaped_body = if body =~ /^\<img/ + escaped_body = if body =~ /\A\<img/ body else escape_once(body) @@ -139,7 +139,7 @@ module GitlabMarkdownHelper @project.path_with_namespace, path_with_ref(file_path), file_path - ].compact.join("/").gsub(/^\/*|\/*$/, '') + id + ].compact.join("/").gsub(/\A\/*|\/*\z/, '') + id end def sanitize_slashes(path) |