mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
6acd0d3f27
commit
b3a4068cea
1 changed files with 10 additions and 5 deletions
|
|
@ -114,11 +114,11 @@ func listDocTree(c *gin.Context) {
|
|||
|
||||
ids := map[string]bool{}
|
||||
for _, entry := range dir {
|
||||
if entry.IsDir() {
|
||||
if strings.HasPrefix(entry.Name(), ".") {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(entry.Name(), ".") {
|
||||
continue
|
||||
}
|
||||
|
||||
if entry.IsDir() {
|
||||
if !ast.IsNodeIDPattern(entry.Name()) {
|
||||
continue
|
||||
}
|
||||
|
|
@ -134,7 +134,12 @@ func listDocTree(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
} else {
|
||||
doc := &DocFile{ID: strings.TrimSuffix(entry.Name(), ".sy")}
|
||||
id := strings.TrimSuffix(entry.Name(), ".sy")
|
||||
if !ast.IsNodeIDPattern(id) {
|
||||
continue
|
||||
}
|
||||
|
||||
doc := &DocFile{ID: id}
|
||||
if !ids[doc.ID] {
|
||||
doctree = append(doctree, doc)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue