Browse Source

feat: add ssr code to editor placeholder for html parser

代强 2 years ago
parent
commit
e6c4635580
1 changed files with 16 additions and 11 deletions
  1. 16 11
      src/templates/postTemplate.js

+ 16 - 11
src/templates/postTemplate.js

@@ -164,17 +164,22 @@ const code = ({ ...props }) => {
     newProps.lineNumber = false;
 
     const Placeholder = () => (
-        <Skeleton
-            active
-            placeholder={
-                <Skeleton.Image
-                    style={{
-                        width: '100%',
-                        height: 518,
-                    }}
-                />
-            }
-        />
+        <>
+            <Skeleton
+                active
+                placeholder={
+                    <Skeleton.Image
+                        style={{
+                            width: '100%',
+                            height: 518,
+                        }}
+                    />
+                }
+            />
+        <div className={"markdown-code-ssr"} style={{display:"none"}}>
+            {props.children}
+        </div>
+        </>
     );
 
     const [Component, _setComponent] = useState(() => Placeholder);