fix(export): apply block quote syntax to every line in annotation export, closes #3534 (#3536)

Add formatBlockQuote utility and blockquote nunjucks filter so both
default and custom template exports prefix every line with `>`.
Document all available formatters in the custom template help panel.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-03-14 22:23:17 +08:00
committed by GitHub
parent db3dee025b
commit f7b2a2432c
32 changed files with 493 additions and 32 deletions
+16
View File
@@ -213,6 +213,22 @@ env.addFilter('nl2br', (value: string) => {
return value.replace(/\n/g, '<br>\n');
});
/**
* Formats text as a markdown block quote, prefixing every line with `> `.
*/
export function formatBlockQuote(text: string): string {
return text
.split('\n')
.map((line) => `> ${line}`)
.join('\n');
}
// Add 'blockquote' filter (prefix every line with > for markdown block quotes)
env.addFilter('blockquote', (value: string) => {
if (!value || typeof value !== 'string') return '';
return formatBlockQuote(value);
});
/**
* Renders a Jinja2/Nunjucks template with the given data
* @param template The template string in Jinja2/Nunjucks syntax