Докрутил парсер, добавил стили проектов

This commit is contained in:
ifraimka1 committed 2025-04-30 12:30:33 +03:00
1 parent ac25dff111
commit f22179654b
3 files changed
+145 -4

No files matched your search

+4 -1
View File
@@ -19,7 +19,7 @@ export const parseContent = (html: string): ParsedContent[] => {
}
// Обработка медиа-элементов (img внутри figure)
if (node.type === "figure") {
if (node.type === "figure" && node.props.className.includes('wp-block-image')) {
const imgSrc = node.props.children?.props?.src;
if (imgSrc) {
mediaBuffer.push(imgSrc);
@@ -48,5 +48,8 @@ export const parseContent = (html: string): ParsedContent[] => {
result.push({ type: "mediablock", value: [...mediaBuffer] });
}
console.log('nonParsedElements', elements);
console.log('parsedElements', result);
return result;
};