Merge pull request #2329 from Vhallo/patch-1

Extending punctuation
This commit is contained in:
Cohee 2024-05-30 23:03:28 +03:00 committed by GitHub
commit 5ec2f33cb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ export function sortByCssOrder(a, b) {
* trimToEndSentence('Hello, world! I am from'); // 'Hello, world!'
*/
export function trimToEndSentence(input, include_newline = false) {
const punctuation = new Set(['.', '!', '?', '*', '"', ')', '}', '`', ']', '$', '。', '', '', '”', '', '】', '', '」']); // extend this as you see fit
const punctuation = new Set(['.', '!', '?', '*', '"', ')', '}', '`', ']', '$', '。', '', '', '”', '', '】', '', '」', '_']); // extend this as you see fit
let last = -1;
for (let i = input.length - 1; i >= 0; i--) {