Skip to content

Commit 00790dc

Browse files
committed
bookstack-auto
1 parent 409a188 commit 00790dc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

conf/app.conf.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# 程序名称
22
appname = BookStack
33

4+
# 内容采集转发。如: https://http-transfer.abc.com
5+
# 需要部署`http-transfer`服务:https://github.com/TruthHun/http-transfer
6+
http_transfer =
7+
48
# 微信小程序 appid
59
appId=""
610

controllers/DocumentController.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,16 +1021,17 @@ func (this *DocumentController) Content() {
10211021
if strings.ToLower(doc.Identify) == "summary.md" {
10221022
if auto {
10231023
icont, _ = newDoc.CreateDocumentTreeForHtml(doc.BookId, doc.DocumentId)
1024+
imd = html2md.Convert(icont)
10241025
} else {
10251026
imd = html2md.Convert(content)
1027+
markdown = imd
10261028
}
1027-
imd = strings.Replace(imd, "(/read/"+identify+"/", "($", -1)
1028-
markdown = imd
10291029
} else {
10301030
imd, icont = newDoc.BookStackAuto(bookId, docId)
10311031
}
10321032
markdown = strings.Replace(markdown, "<bookstack-auto></bookstack-auto>", imd, -1)
10331033
content = strings.Replace(content, "<bookstack-auto></bookstack-auto>", icont, -1)
1034+
markdown = strings.Replace(markdown, "(/read/"+identify+"/", "($", -1)
10341035
isAuto = true && !isSummary
10351036
}
10361037

0 commit comments

Comments
 (0)