mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix lint
This commit is contained in:
parent
9bb0884f89
commit
fdee7efa03
@ -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.
|
// 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]*))$')
|
const regX = build('^/search/hashtag/((\\pL+[\\pL0-9]*)|([0-9]+\\pL+[\\pL0-9]*))$')
|
||||||
|
|
||||||
export default function (content) {
|
export default function(content) {
|
||||||
if (!content) return []
|
if (!content) return []
|
||||||
const $ = cheerio.load(content)
|
const $ = cheerio.load(content)
|
||||||
// We can not search for class '.hashtag', because the classes are removed at the 'xss' middleware.
|
// We can not search for class '.hashtag', because the classes are removed at the 'xss' middleware.
|
||||||
|
|||||||
@ -216,7 +216,7 @@ export default {
|
|||||||
sanitizeQuery(query) {
|
sanitizeQuery(query) {
|
||||||
if (this.suggestionType === HASHTAG) {
|
if (this.suggestionType === HASHTAG) {
|
||||||
const regexMatchAllNonUnicodeOrDigits = build('[^\\pL0-9]')
|
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
|
// if the query is only made of digits, make it empty
|
||||||
return query.replace(/[0-9]/gm, '') === '' ? '' : query
|
return query.replace(/[0-9]/gm, '') === '' ? '' : query
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user