/g, '');
+ // limit shown content length, but keep the html tags which are not closed
+ marked_content = truncate(marked_content, 130);
+ // default end is '...', remove it
+ marked_content = marked_content.replace(/\.\.\.$/, "");
+ // get the last tag of the content
+ let lastTag = marked_content.lastIndexOf('<');
+ // record the last tag
+ let lastTagContent = marked_content.substring(lastTag);
+ // remove the last tag
+ marked_content = marked_content.substring(0, lastTag);
+ let end = "……  [阅读更多]" + lastTagContent;
+ return marked_content + end;
+}
export interface Props {
id?: string;
@@ -60,10 +87,14 @@ export default function Card({ id, href, frontmatter, secHeading = true, body, p
{/* */}
{publishCard &&
-
- {body?.replace("#", "")?.substring(0, 130)}
- [阅读更多]
-
+ // 去掉段后间隔
+
+ {/* 注意需要my-0否则继承 */}
+
+
+
+
}
);