Files
geo/apps/desktop-client/src/main/adapters/wangyihao-content.ts
T
root bf25fa1a80 feat(desktop-client/wangyihao): harden token capture and draft submit flow
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>
2026-04-30 18:15:20 +08:00

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();
}