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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8423ed74
Commit
8423ed74
authored
Nov 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
2af6d2c4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1680 additions
and
290 deletions
+1680
-290
app/helpers/markup_helper.rb
app/helpers/markup_helper.rb
+8
-5
changelogs/unreleased/harishsr-emoticon-commit-links.yml
changelogs/unreleased/harishsr-emoticon-commit-links.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+1017
-31
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+643
-253
spec/helpers/markup_helper_spec.rb
spec/helpers/markup_helper_spec.rb
+7
-1
No files found.
app/helpers/markup_helper.rb
View file @
8423ed74
...
...
@@ -51,12 +51,15 @@ module MarkupHelper
text
=
fragment
.
children
[
0
].
text
fragment
.
children
[
0
].
replace
(
link_to
(
text
,
url
,
html_options
))
else
# Traverse the fragment's first generation of children looking for pure
# text, wrapping anything found in the requested link
# Traverse the fragment's first generation of children looking for
# either pure text or emojis, wrapping anything found in the
# requested link
fragment
.
children
.
each
do
|
node
|
next
unless
node
.
text?
node
.
replace
(
link_to
(
node
.
text
,
url
,
html_options
))
if
node
.
text?
node
.
replace
(
link_to
(
node
.
text
,
url
,
html_options
))
elsif
node
.
name
==
'gl-emoji'
node
.
replace
(
link_to
(
node
.
to_html
.
html_safe
,
url
,
html_options
))
end
end
end
...
...
changelogs/unreleased/harishsr-emoticon-commit-links.yml
0 → 100644
View file @
8423ed74
---
title
:
Allow emojis to be linkable
merge_request
:
18014
author
:
type
:
fixed
doc/api/graphql/reference/gitlab_schema.graphql
View file @
8423ed74
This diff is collapsed.
Click to expand it.
doc/api/graphql/reference/gitlab_schema.json
View file @
8423ed74
This diff is collapsed.
Click to expand it.
spec/helpers/markup_helper_spec.rb
View file @
8423ed74
...
...
@@ -210,7 +210,7 @@ describe MarkupHelper do
it
'replaces commit message with emoji to link'
do
actual
=
link_to_markdown
(
':book: Book'
,
'/foo'
)
expect
(
actual
)
.
to
eq
'<
gl-emoji title="open book" data-name="book" data-unicode-version="6.0">📖</gl-emoji
><a href="/foo"> Book</a>'
.
to
eq
'<
a href="/foo"><gl-emoji title="open book" data-name="book" data-unicode-version="6.0">📖</gl-emoji></a
><a href="/foo"> Book</a>'
end
end
...
...
@@ -232,6 +232,12 @@ describe MarkupHelper do
expect
(
doc
.
css
(
'a'
)[
0
].
attr
(
'href'
)).
to
eq
link
expect
(
doc
.
css
(
'a'
)[
0
].
text
).
to
eq
'This should finally fix '
end
it
"escapes HTML passed as an emoji"
do
rendered
=
'<gl-emoji><div class="test">test</div></gl-emoji>'
expect
(
helper
.
link_to_html
(
rendered
,
'/foo'
))
.
to
eq
'<a href="/foo"><gl-emoji><div class="test">test</div></gl-emoji></a>'
end
end
describe
'#render_wiki_content'
do
...
...
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