mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00: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{}
|
ids := map[string]bool{}
|
||||||
for _, entry := range dir {
|
for _, entry := range dir {
|
||||||
if entry.IsDir() {
|
|
||||||
if strings.HasPrefix(entry.Name(), ".") {
|
if strings.HasPrefix(entry.Name(), ".") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if entry.IsDir() {
|
||||||
if !ast.IsNodeIDPattern(entry.Name()) {
|
if !ast.IsNodeIDPattern(entry.Name()) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
@ -134,7 +134,12 @@ func listDocTree(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} 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] {
|
if !ids[doc.ID] {
|
||||||
doctree = append(doctree, doc)
|
doctree = append(doctree, doc)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue