From 98a338ca1dbd1b7072cf68691b90b04ed069b1f7 Mon Sep 17 00:00:00 2001 From: Frostime Date: Fri, 9 Aug 2024 07:11:47 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(protyle):=20=E5=9C=A8`genASTBy?= =?UTF-8?q?BlockDOM`=E5=87=BD=E6=95=B0=E4=B8=AD=E5=BF=BD=E7=95=A5"protyle-?= =?UTF-8?q?custom"=E7=B1=BB=E7=9A=84=E8=8A=82=E7=82=B9=20(#207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protyle.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protyle.go b/protyle.go index b0e0d4d01f..cd9c5dbab3 100644 --- a/protyle.go +++ b/protyle.go @@ -683,6 +683,12 @@ func (lute *Lute) blockDOM2Md(htmlStr string) (markdown string) { func (lute *Lute) genASTByBlockDOM(n *html.Node, tree *parse.Tree) { class := util.DomAttrValue(n, "class") + + //Custom dom, which will be omitted when build tree + if strings.Contains(class, "protyle-custom") { + return + } + if "protyle-attr" == class || strings.Contains(class, "__copy") || strings.Contains(class, "protyle-linenumber__rows") {