mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 06:19:45 +00:00
Пофиксил проблему загрузки постов
This commit is contained in:
1 parent
1303ba3c89
commit
6684449986
2 files changed
+3
-6
No files matched your search
@@ -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;
|
||||
};
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user