bf25fa1a80
Inject the YiDun guardian client to obtain ursToken without relying on window.neg, fetch the publish detail (wemediaId/onlineState/...) before saving drafts so 100002 "参数错误" stops blocking submit, downgrade markdown tables to paragraph rows like Baijiahao, and surface friendlier errors for token, draft and publish-click failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
482 B
TypeScript
16 lines
482 B
TypeScript
import type { DesktopArticleContent } from "@geo/shared-types";
|
|
import {
|
|
prepareBaijiahaoMarkdown,
|
|
renderTablesAsParagraphRows,
|
|
} from "../../../../../packages/publisher-platforms/src/baijiahao";
|
|
|
|
import { normalizeArticleHtml } from "./common";
|
|
|
|
export function prepareWangyihaoArticleHtml(article: DesktopArticleContent): string {
|
|
return renderTablesAsParagraphRows(
|
|
normalizeArticleHtml(article, {
|
|
prepareMarkdown: prepareBaijiahaoMarkdown,
|
|
}),
|
|
).trim();
|
|
}
|