"use client";
import { toWechatHtml } from "./wechat";
import { copyHtml } from "./clipboard";
/**
* Zhihu accepts the same kind of inlined HTML as WeChat, but math expressions
* need
. We strip MathJax containers and replace.
*/
export function toZhihuHtml(fullHtml: string): string {
let html = toWechatHtml(fullHtml);
// Replace any mjx-container with the data-eeimg image markup
html = html.replace(
/]*?>([\s\S]*?)<\/mjx-container>/g,
(_full, inner) => {
const tex = (inner.match(/aria-label="([^"]*)"/) ?? [])[1] ??
(inner.match(/