summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkushalpandya <kushal@gitlab.com>2017-05-11 15:19:16 +0530
committerkushalpandya <kushal@gitlab.com>2017-05-12 19:35:35 +0530
commit6b9f41a3f29d76ed2fd113e2056adc122e80ead5 (patch)
tree383d60eec3eba15ff936c9af24ee0b67c6cabf08
parentaff8a343bde0cbfdb5cbb3fee15f4d88dfe5893a (diff)
downloadgitlab-ce-32016-fix-slash-commands-detection.tar.gz
Remove unused `stripSlashCommand` method32016-fix-slash-commands-detection
-rw-r--r--app/assets/javascripts/notes.js12
-rw-r--r--spec/javascripts/notes_spec.js12
2 files changed, 0 insertions, 24 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index 2b4a1a474e3..b29a27b7d37 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -1148,18 +1148,6 @@ const normalizeNewlines = function(str) {
};
/**
- * Remove slash commands and leave comment with pure message
- * this command is very less likely to be used in production
- * as gl.GfmAutoComplete.cachedData['/'] is initialized the moment
- * user starts typing any slash command, but during Karma tests
- * it is not available
- */
- Notes.prototype.stripSlashCommands = function (formContent) {
- const REGEX_SLASH_COMMANDS = /\/\w+/g;
- return formContent.replace(REGEX_SLASH_COMMANDS, '').trim();
- };
-
- /**
* Identify if formContent has any slash commands
* and generates placeholder note's content.
*/
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js
index 0c4cd07134f..12cf3661ed7 100644
--- a/spec/javascripts/notes_spec.js
+++ b/spec/javascripts/notes_spec.js
@@ -371,18 +371,6 @@ import '~/notes';
});
});
- describe('stripSlashCommands', () => {
- const REGEX_SLASH_COMMANDS = /\/\w+/g;
-
- it('should strip slash commands from the comment', () => {
- this.notes = new Notes();
- const sampleComment = '/wip /milestone %1.0 /merge /unassign Merging this';
- const stripedComment = this.notes.stripSlashCommands(sampleComment);
-
- expect(REGEX_SLASH_COMMANDS.test(stripedComment)).toBeFalsy();
- });
- });
-
describe('generatePlaceholderNoteContent', () => {
const availableSlashCommands = [
{ name: 'close', description: 'Close this issue', params: [] },