mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into smol-tag-improvements
This commit is contained in:
@ -491,7 +491,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--) {
|
||||
@ -647,6 +647,9 @@ function parseTimestamp(timestamp) {
|
||||
|
||||
// Unix time (legacy TAI / tags)
|
||||
if (typeof timestamp === 'number') {
|
||||
if (isNaN(timestamp) || !isFinite(timestamp) || timestamp < 0) {
|
||||
return moment.invalid();
|
||||
}
|
||||
return moment(timestamp);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user