// تست موقت رندر استاتیک و ابزارها — پس از اجرا حذف میشود import { renderToHTMLString } from '@tiptap/static-renderer' import { ARTICLE_EXTENSIONS } from './src/components/admin/ArticleEditor' import { formatReadingTime, readingTimeMinutes } from './src/utils/readingTime' import { buildLinkRel, normalizeHref, parseLinkRel } from './src/utils/link' import { docHeadings, docImages, docToText } from './src/utils/tiptapDoc' const doc = { type: 'doc', content: [ { type: 'paragraph', content: [{ type: 'text', text: 'متن نمونه مقاله برای تست رندر' }] }, { type: 'image', attrs: { src: '/media/a.jpg', alt: 'تصویر تست', title: 'Photo 1', caption: 'کپشن تصویر تست' }, }, { type: 'paragraph', content: [ { type: 'text', text: 'لینک خارجی', marks: [{ type: 'link', attrs: { href: 'https://example.com', target: '_blank', rel: 'noopener noreferrer nofollow' } }], }, ], }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'تیتر دوم' }] }, ], } const html = renderToHTMLString({ extensions: ARTICLE_EXTENSIONS, content: doc as never }) console.log('--- rendered html ---') console.log(html) console.log('--- checks ---') console.log('has figure:', html.includes('