From fdee7efa0368f61e82d23ef3d09d83075452603f Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 4 Sep 2019 08:12:11 +0200 Subject: [PATCH] Fix lint --- backend/src/middleware/hashtags/extractHashtags.js | 2 +- webapp/components/Editor/Editor.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/middleware/hashtags/extractHashtags.js b/backend/src/middleware/hashtags/extractHashtags.js index dfb993f82..c7782e59d 100644 --- a/backend/src/middleware/hashtags/extractHashtags.js +++ b/backend/src/middleware/hashtags/extractHashtags.js @@ -8,7 +8,7 @@ import { exec, build } from 'xregexp/xregexp-all.js' // 2. If it starts with a digit '0-9' than a unicode character has to follow. const regX = build('^/search/hashtag/((\\pL+[\\pL0-9]*)|([0-9]+\\pL+[\\pL0-9]*))$') -export default function (content) { +export default function(content) { if (!content) return [] const $ = cheerio.load(content) // We can not search for class '.hashtag', because the classes are removed at the 'xss' middleware. diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 4d51ebefb..25080737a 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -216,7 +216,7 @@ export default { sanitizeQuery(query) { if (this.suggestionType === HASHTAG) { const regexMatchAllNonUnicodeOrDigits = build('[^\\pL0-9]') - query = replace(query, regX, '', 'all') + query = replace(query, regexMatchAllNonUnicodeOrDigits, '', 'all') // if the query is only made of digits, make it empty return query.replace(/[0-9]/gm, '') === '' ? '' : query }