diff options
author | winniehell <git@winniehell.de> | 2016-11-07 01:16:39 +0100 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2016-12-01 23:16:09 +0100 |
commit | f90b6200e450f6b87cc310ab5734a09719d891d3 (patch) | |
tree | 2522b847828a73bd3bbdf9e016f3f23f060dcb46 /app/assets/javascripts/gfm_auto_complete.js.es6 | |
parent | 629624f30f6ad2f31681772adf88ace6f28727c9 (diff) | |
download | gitlab-ce-f90b6200e450f6b87cc310ab5734a09719d891d3.tar.gz |
Clean up common_utils.js (!7318)
Diffstat (limited to 'app/assets/javascripts/gfm_auto_complete.js.es6')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js.es6 | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js.es6 b/app/assets/javascripts/gfm_auto_complete.js.es6 index 10769b7fd4f..6f9d6283071 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.es6 +++ b/app/assets/javascripts/gfm_auto_complete.js.es6 @@ -5,6 +5,10 @@ window.GitLab = {}; } + function sanitize(str) { + return str.replace(/<(?:.|\n)*?>/gm, ''); + } + GitLab.GfmAutoComplete = { dataLoading: false, dataLoaded: false, @@ -160,8 +164,8 @@ return { username: m.username, avatarTag: autoCompleteAvatar.length === 1 ? txtAvatar : imgAvatar, - title: gl.utils.sanitize(title), - search: gl.utils.sanitize(m.username + " " + m.name) + title: sanitize(title), + search: sanitize(m.username + " " + m.name) }; }); } @@ -195,7 +199,7 @@ } return { id: i.iid, - title: gl.utils.sanitize(i.title), + title: sanitize(i.title), search: i.iid + " " + i.title }; }); @@ -228,7 +232,7 @@ } return { id: m.iid, - title: gl.utils.sanitize(m.title), + title: sanitize(m.title), search: "" + m.title }; }); @@ -263,7 +267,7 @@ } return { id: m.iid, - title: gl.utils.sanitize(m.title), + title: sanitize(m.title), search: m.iid + " " + m.title }; }); @@ -284,9 +288,9 @@ var sanitizeLabelTitle; sanitizeLabelTitle = function(title) { if (/[\w\?&]+\s+[\w\?&]+/g.test(title)) { - return "\"" + (gl.utils.sanitize(title)) + "\""; + return "\"" + (sanitize(title)) + "\""; } else { - return gl.utils.sanitize(title); + return sanitize(title); } }; return $.map(merges, function(m) { |