feat: update frontend schedule task fields, zhihu table format, and shared types

Persist enable_web_search and generate_count in GenerateTaskDrawer.
Display generate_count in ScheduleTaskTab. Add Zhihu table format
conversion for compatibility. Extend shared types with batch generation
response fields. Strengthen outline adherence rule in prompts config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 14:21:19 +08:00
parent 6869dc2fa6
commit 4d06938565
5 changed files with 34 additions and 3 deletions
@@ -119,6 +119,20 @@ function wrapStandaloneImages(html: string): string {
return root.innerHTML.trim();
}
function convertTablesToZhihuFormat(html: string): string {
let next = html;
// Zhihu requires all rows in a single <tbody> — merge <thead> into <tbody>
next = next.replace(/<\/thead>\s*<tbody>/gi, "");
next = next.replace(/<thead>/gi, "<tbody>");
next = next.replace(/<\/thead>/gi, "</tbody>");
// Mark tables with Zhihu data-draft attributes so the sanitizer preserves them
next = next.replace(
/<table\b/gi,
'<table data-draft-node="block" data-draft-type="table" data-draft-padding="8"',
);
return next;
}
function transformContent(html: string): string {
let next = html.trim();
@@ -129,6 +143,7 @@ function transformContent(html: string): string {
next = next.replace(/<figure[^>]*>\s*(<img[\s\S]*?>)\s*<\/figure>/gi, "$1");
next = next.replace(/<pre><code class="language-([^"]+)">/gi, '<pre lang="$1"><code>');
next = wrapStandaloneImages(next);
next = convertTablesToZhihuFormat(next);
return next;
}