diff options
author | haseeb <haseebeqx@gmail.com> | 2017-11-13 17:30:22 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-11-13 17:30:22 +0300 |
commit | d2d7bfa7603473d6850eb51dbe4ff275e6f7c379 (patch) | |
tree | 5e12ef44e34f81f3b39b74b4f492f6a5a825f689 /app/assets | |
parent | 2e13dafbe822077280a5e30d9807963af457e20e (diff) |
fix to allow integer label refernces
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 5c624b79d45..a642464c920 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -338,7 +338,8 @@ class GfmAutoComplete { let resultantValue = value; if (value && !this.setting.skipSpecialCharacterTest) { const withoutAt = value.substring(1); - if (withoutAt && /[^\w\d]/.test(withoutAt)) { + const regex = value.charAt() === '~' ? /\W|^\d+$/ : /\W/; + if (withoutAt && regex.test(withoutAt)) { resultantValue = `${value.charAt()}"${withoutAt}"`; } } |