Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
f72dc7f7
Commit
f72dc7f7
authored
Jan 29, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dont escape images inside links for gfm. Fixes #2701
parent
1c931fb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
app/helpers/gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+7
-1
No files found.
app/helpers/gitlab_markdown_helper.rb
View file @
f72dc7f7
...
@@ -13,7 +13,13 @@ module GitlabMarkdownHelper
...
@@ -13,7 +13,13 @@ module GitlabMarkdownHelper
def
link_to_gfm
(
body
,
url
,
html_options
=
{})
def
link_to_gfm
(
body
,
url
,
html_options
=
{})
return
""
if
body
.
blank?
return
""
if
body
.
blank?
gfm_body
=
gfm
(
escape_once
(
body
),
html_options
)
escaped_body
=
if
body
=~
/^\<img/
body
else
escape_once
(
body
)
end
gfm_body
=
gfm
(
escaped_body
,
html_options
)
gfm_body
.
gsub!
(
%r{<a.*?>.*?</a>}m
)
do
|
match
|
gfm_body
.
gsub!
(
%r{<a.*?>.*?</a>}m
)
do
|
match
|
"</a>
#{
match
}#{
link_to
(
""
,
url
,
html_options
)[
0
..-
5
]
}
"
# "</a>".length +1
"</a>
#{
match
}#{
link_to
(
""
,
url
,
html_options
)[
0
..-
5
]
}
"
# "</a>".length +1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment