mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-13 16:37:52 +00:00
fix filterLang() to cut out 'twist:…=' links before processing
This commit is contained in:
parent
a9c8f71ab0
commit
d2cd9cdea0
@ -551,7 +551,7 @@ function filterLang(string) {
|
|||||||
langFilterReason = polyglot.t('this doesnt contain that', {'this': polyglot.t(langFilterMode), 'that': polyglot.t('language of this')});
|
langFilterReason = polyglot.t('this doesnt contain that', {'this': polyglot.t(langFilterMode), 'that': polyglot.t('language of this')});
|
||||||
|
|
||||||
// before detection attempts we cut out any mentions and links, and replace _ with space
|
// before detection attempts we cut out any mentions and links, and replace _ with space
|
||||||
langFilterSubj = string.replace(/@\S\w*|https?:\/\/\S*/g, '').replace(/_+/g, ' ')
|
langFilterSubj = string.replace(/@\S\w*|https?:\/\/\S*|twist:\S\S\S\S\S\S\S\S\S\S\S=/g, '').replace(/_+/g, ' ')
|
||||||
// cut out common frequently used words FIXME I believe there is a list of similar international stuff somewhere outside which is waiting for us, we should just find it
|
// cut out common frequently used words FIXME I believe there is a list of similar international stuff somewhere outside which is waiting for us, we should just find it
|
||||||
.replace(/\btwister|tox|github|linux|ubuntu|debian|windows|google|twitter|facebook|microsoft|ping|pong|email|javascript\b/ig, '')
|
.replace(/\btwister|tox|github|linux|ubuntu|debian|windows|google|twitter|facebook|microsoft|ping|pong|email|javascript\b/ig, '')
|
||||||
// replace zero-width word boundaries, such as between letters from different alphabets [or other symbols], with spaces
|
// replace zero-width word boundaries, such as between letters from different alphabets [or other symbols], with spaces
|
||||||
|
Loading…
Reference in New Issue
Block a user