Merge branch 'staging' into smol-tag-improvements

This commit is contained in:
Wolfsblvt
2024-06-02 21:07:46 +02:00
93 changed files with 4666 additions and 1911 deletions

View File

@ -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);
}