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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user