fix: allow quote-inline class in mocks sanitizer so quote-post fallback elements can be detected and removed during title generation, fixes #13688

This commit is contained in:
Julian Lam
2025-10-01 12:13:57 -04:00
parent 954e7bc8e3
commit 675178aca4
2 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ const sanitizeConfig = {
allowedTags: sanitize.defaults.allowedTags.concat(['img', 'picture', 'source']),
allowedClasses: {
'*': [],
'p': ['quote-inline'],
},
allowedAttributes: {
a: ['href', 'rel'],

View File

@@ -156,7 +156,10 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
// mainPid ok to leave as-is
if (!title) {
const prettified = pretty(content || sourceContent);
let prettified = pretty(content || sourceContent);
// Remove any lines that contain quote-post fallbacks
prettified = prettified.split('\n').filter(line => !line.startsWith('<p class="quote-inline"')).join('\'n');
const sentences = tokenizer.sentences(prettified, { sanitize: true, newline_boundaries: true });
title = sentences.shift();
}