Пофиксил проблему загрузки постов

This commit is contained in:
ifraimka1 committed 2025-05-06 17:21:25 +03:00
1 parent 1303ba3c89
commit 6684449986
2 files changed
+3 -6

No files matched your search

+2 -5
View File
@@ -34,7 +34,7 @@ export const parseContent = (html: string): ParsedContent[] => {
mediaBuffer = [];
}
if (node.props.className.includes('wp-block-gallery')) {
if (node.props.className?.includes('wp-block-gallery')) {
const slider = [];
for (const child of node.props.children) {
const imgSrc = child.props?.children.props?.src;
@@ -42,7 +42,7 @@ export const parseContent = (html: string): ParsedContent[] => {
slider.push(imgSrc);
}
}
result.push({ type: "slider", value: slider })
result.push({ type: "slider", value: slider });
return;
}
@@ -61,8 +61,5 @@ export const parseContent = (html: string): ParsedContent[] => {
result.push({ type: "mediablock", value: [...mediaBuffer] });
}
console.log('nonParsedElements', elements);
console.log('parsedElements', result);
return result;
};
+1 -1
View File
@@ -291,7 +291,7 @@ declare namespace App {
value: string[];
}
export type ParsedContent = HtmlElement | MediaBlock;
export type ParsedContent = HtmlElement | MediaBlock | Slider;
export interface WpPost {
id: number;