From 2ca33753e0e75a78dbd65a9770f644c1620e25c2 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 10 Jun 2022 09:40:36 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=AF=BC=E5=85=A5=E5=8C=85=E5=90=AB=20?= =?UTF-8?q?`.`=20=E7=9A=84=20Markdown=20=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20Fix=20https://github.com/siyuan-note/siyua?= =?UTF-8?q?n/issues/5148?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/import.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/model/import.go b/kernel/model/import.go index fa875265c..61f3919bb 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -407,9 +407,12 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) { } var tree *parse.Tree - - ext := path.Ext(info.Name()) - title := strings.TrimSuffix(info.Name(), ext) + var ext string + title := info.Name() + if !info.IsDir() { + ext = path.Ext(info.Name()) + title = strings.TrimSuffix(info.Name(), ext) + } id := ast.NewNodeID() curRelPath := filepath.ToSlash(strings.TrimPrefix(currentPath, localPath))