Skip to content

Commit

Permalink
Handle ideographic space in symbols filter (#289)
Browse files Browse the repository at this point in the history
* Handle ideographic space in symbols filter

* fix-lint
  • Loading branch information
inverse authored Aug 25, 2023
1 parent f262565 commit b2bcd52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const SUFFIX_FILTER_RULES: FilterRule[] = [
];

/**
* Special filter rules to remove leftoves after filtering text using
* Special filter rules to remove leftovers after filtering text using
* `YOUTUBE_TRACK_FILTER_RULES` filter rules.
*/
export const TRIM_SYMBOLS_FILTER_RULES: FilterRule[] = [
Expand All @@ -108,7 +108,7 @@ export const TRIM_SYMBOLS_FILTER_RULES: FilterRule[] = [
// trim trailing white chars and dash
{ source: /[/,:;~\s"-]+$/, target: '' },
// remove multiple spaces
{ source: /\s{1,}/, target: ' ' },
{ source: /\u0020{1,}/, target: ' ' },
];

/**
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/functions/youtube.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,5 +433,10 @@
"description": "should remove multiple spaces",
"funcParameter": "Imminent (Lyric Video) ft. Joshua Idehen",
"expectedValue": "Imminent ft. Joshua Idehen"
},
{
"description": "shouldn't remove ideographic space",
"funcParameter": "space between",
"expectedValue": "space between"
}
]

0 comments on commit b2bcd52

Please sign in to comment.