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
80ad1c62
Commit
80ad1c62
authored
Jan 23, 2017
by
samrose3
Committed by
Sam Rose
Feb 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support non-ASCII characters in GFM autocomplete
parent
797ca1b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
app/assets/javascripts/gfm_auto_complete.js.es6
app/assets/javascripts/gfm_auto_complete.js.es6
+2
-2
changelogs/unreleased/27067-mention-user-dropdown-does-not-suggest-by-non-ascii-characters-in-name.yml
...down-does-not-suggest-by-non-ascii-characters-in-name.yml
+4
-0
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+14
-1
No files found.
app/assets/javascripts/gfm_auto_complete.js.es6
View file @
80ad1c62
...
...
@@ -83,12 +83,12 @@
_a = decodeURI("%C3%80");
_y = decodeURI("%C3%BF");
regexp = new RegExp("^(?:\\B|[^a-zA-Z0-9_" + atSymbolsWithoutBar + "]|\\s)" + flag + "(?![" + atSymbolsWithBar + "])(
[A-Za-z" + _a + "-" + _y + "0-9_\'\.\+\-]
*)$", 'gi');
regexp = new RegExp("^(?:\\B|[^a-zA-Z0-9_" + atSymbolsWithoutBar + "]|\\s)" + flag + "(?![" + atSymbolsWithBar + "])(
([A-Za-z" + _a + "-" + _y + "0-9_\'\.\+\-]|[^\\x00-\\x7a])
*)$", 'gi');
match = regexp.exec(subtext);
if (match) {
return
match[2] || match[1
];
return
(match[1] || match[1] === "") ? match[1] : match[2
];
} else {
return null;
}
...
...
changelogs/unreleased/27067-mention-user-dropdown-does-not-suggest-by-non-ascii-characters-in-name.yml
0 → 100644
View file @
80ad1c62
---
title
:
Support non-ASCII characters in GFM autocomplete
merge_request
:
8729
author
:
spec/features/issues/gfm_autocomplete_spec.rb
View file @
80ad1c62
...
...
@@ -2,7 +2,7 @@ require 'rails_helper'
feature
'GFM autocomplete'
,
feature:
true
,
js:
true
do
include
WaitForAjax
let
(
:user
)
{
create
(
:user
,
username:
'someone.special'
)
}
let
(
:user
)
{
create
(
:user
,
name:
'💃speciąl someone💃'
,
username:
'someone.special'
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'special+'
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
...
...
@@ -59,6 +59,19 @@ feature 'GFM autocomplete', feature: true, js: true do
expect
(
find
(
'#at-view-64'
)).
to
have_selector
(
'.cur:first-of-type'
)
end
it
'includes items for assignee dropdowns with non-ASCII characters in name'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note_note'
).
native
.
send_keys
(
''
)
find
(
'#note_note'
).
native
.
send_keys
(
"@
#{
user
.
name
[
0
...
8
]
}
"
)
end
expect
(
page
).
to
have_selector
(
'.atwho-container'
)
wait_for_ajax
expect
(
find
(
'#at-view-64'
)).
to
have_content
(
user
.
name
)
end
it
'selects the first item for non-assignee dropdowns if a query is entered'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note_note'
).
native
.
send_keys
(
''
)
...
...
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