Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Nov 26, 2024
2 parents bd89dd6 + 9274b37 commit 9860fc7
Show file tree
Hide file tree
Showing 12 changed files with 217 additions and 29 deletions.
48 changes: 47 additions & 1 deletion app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p.sy
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,55 @@
"title": "Please Start Here",
"title-img": "background-color:#556;background-image: linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a);background-size:80px 140px;background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;",
"type": "doc",
"updated": "20241018102340"
"updated": "20241125224626"
},
"Children": [
{
"ID": "20241125224615-dwfqru1",
"Type": "NodeBlockquote",
"Properties": {
"id": "20241125224615-dwfqru1",
"updated": "20241125224626"
},
"Children": [
{
"Type": "NodeBlockquoteMarker",
"Data": "\u003e"
},
{
"ID": "20241125224615-z2fevdf",
"Type": "NodeParagraph",
"Properties": {
"id": "20241125224615-z2fevdf",
"updated": "20241125224626"
},
"Children": [
{
"Type": "NodeText",
"Data": "When you close SiYuan Notes, the User Guide will be automatically closed. You can click "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "Main Menu"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "User Guide"
},
{
"Type": "NodeText",
"Data": " to view it again"
}
]
}
]
},
{
"ID": "20210528120135-bznvpp6",
"Type": "NodeSuperBlock",
Expand Down
48 changes: 47 additions & 1 deletion app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa.sy
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,55 @@
"title": "请从这里开始",
"title-img": "background-color:#556;background-image: linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a);background-size:80px 140px;background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;",
"type": "doc",
"updated": "20241018102134"
"updated": "20241125224159"
},
"Children": [
{
"ID": "20241125224159-8zf3bos",
"Type": "NodeBlockquote",
"Properties": {
"id": "20241125224159-8zf3bos",
"updated": "20241125224159"
},
"Children": [
{
"Type": "NodeBlockquoteMarker",
"Data": "\u003e"
},
{
"ID": "20241125224159-vcaj2bv",
"Type": "NodeParagraph",
"Properties": {
"id": "20241125224159-vcaj2bv",
"updated": "20241125224159"
},
"Children": [
{
"Type": "NodeText",
"Data": "关闭思源笔记时会自动关闭用户指南,可以点击 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "主菜单"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "用户指南"
},
{
"Type": "NodeText",
"Data": " 再次查看"
}
]
}
]
},
{
"ID": "20210528115012-vst5lwt",
"Type": "NodeSuperBlock",
Expand Down
48 changes: 47 additions & 1 deletion app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq.sy
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,55 @@
"title": "請從這裡開始",
"title-img": "background-color:#556;background-image: linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a);background-size:80px 140px;background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;",
"type": "doc",
"updated": "20241018105300"
"updated": "20241125224503"
},
"Children": [
{
"ID": "20241125224503-8vqkbc9",
"Type": "NodeBlockquote",
"Properties": {
"id": "20241125224503-8vqkbc9",
"updated": "20241125224503"
},
"Children": [
{
"Type": "NodeBlockquoteMarker",
"Data": "\u003e"
},
{
"ID": "20241125224503-fqq0875",
"Type": "NodeParagraph",
"Properties": {
"id": "20241125224503-fqq0875",
"updated": "20241125224503"
},
"Children": [
{
"Type": "NodeText",
"Data": "關閉思源筆記時會自動關閉用戶指南,可以點擊 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "主菜單"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "用戶指南"
},
{
"Type": "NodeText",
"Data": " ​再次查看"
}
]
}
]
},
{
"ID": "20211226115745-rorv31l",
"Type": "NodeSuperBlock",
Expand Down
48 changes: 47 additions & 1 deletion app/guide/20240530133126-axarxgx/20240530101000-4qitucx.sy
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,55 @@
"title": "スタートガイド",
"title-img": "background-color:#556;background-image: linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(30deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(150deg, #445 12%, transparent 12.5%, transparent 87%, #445 87.5%, #445),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a),linear-gradient(60deg, #99a 25%, transparent 25.5%, transparent 75%, #99a 75%, #99a);background-size:80px 140px;background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;",
"type": "doc",
"updated": "20241018102426"
"updated": "20241125225136"
},
"Children": [
{
"ID": "20241125224702-5a9o34q",
"Type": "NodeBlockquote",
"Properties": {
"id": "20241125224702-5a9o34q",
"updated": "20241125225136"
},
"Children": [
{
"Type": "NodeBlockquoteMarker",
"Data": "\u003e"
},
{
"ID": "20241125225100-s0akx3f",
"Type": "NodeParagraph",
"Properties": {
"id": "20241125225100-s0akx3f",
"updated": "20241125225136"
},
"Children": [
{
"Type": "NodeText",
"Data": "SiYuan を閉じると、ユーザーガイドは自動的に閉じられます。"
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "メインメニュー"
},
{
"Type": "NodeText",
"Data": " - "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "ユーザーガイド"
},
{
"Type": "NodeText",
"Data": " ​をクリックすると、再度表示できます"
}
]
}
]
},
{
"ID": "20240530101000-x3xk6o7",
"Type": "NodeSuperBlock",
Expand Down
2 changes: 1 addition & 1 deletion app/stage/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const INITIAL_CACHED_RESOURCES = [
"/stage/icon-large.png",
"/stage/icon.png",
"/stage/loading-pure.svg",
"/stage/build/fonts/JetBrainsMono-Regular.woff",
"/stage/build/fonts/JetBrainsMono-Regular.woff2",
"/stage/protyle/js/lute/lute.min.js",
"/stage/protyle/js/protyle-html.js"
];
Expand Down
4 changes: 2 additions & 2 deletions app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ module.exports = (env, argv) => {
],
},
{
test: /\.woff$/,
test: /\.woff2$/,
type: "asset/resource",
generator: {
filename: "../fonts/JetBrainsMono-Regular.woff",
filename: "../fonts/JetBrainsMono-Regular.woff2",
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/webpack.desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ module.exports = (env, argv) => {
],
},
{
test: /\.woff$/,
test: /\.woff2$/,
type: "asset/resource",
generator: {
filename: "../fonts/JetBrainsMono-Regular.woff",
filename: "../fonts/JetBrainsMono-Regular.woff2",
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions app/webpack.export.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ module.exports = (env, argv) => {
],
},
{
test: /\.woff$/,
test: /\.woff2$/,
type: "asset/resource",
generator: {
filename: "../fonts/JetBrainsMono-Regular.woff",
filename: "../fonts/JetBrainsMono-Regular.woff2",
},
},
],
Expand Down
4 changes: 2 additions & 2 deletions app/webpack.mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ module.exports = (env, argv) => {
],
},
{
test: /\.woff$/,
test: /\.woff2$/,
type: "asset/resource",
generator: {
filename: "../fonts/JetBrainsMono-Regular.woff",
filename: "../fonts/JetBrainsMono-Regular.woff2",
},
},
{
Expand Down
6 changes: 1 addition & 5 deletions kernel/model/backlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,7 @@ func matchBacklinkKeyword(block *Block, keywords []string) bool {

for _, k := range keywords {
k = strings.ToLower(k)
content := block.Content
if block.IsContainerBlock() {
content = block.FContent
}
if strings.Contains(strings.ToLower(content), k) ||
if strings.Contains(strings.ToLower(block.Content), k) ||
strings.Contains(strings.ToLower(path.Base(block.HPath)), k) ||
strings.Contains(strings.ToLower(block.Name), k) ||
strings.Contains(strings.ToLower(block.Alias), k) ||
Expand Down
10 changes: 9 additions & 1 deletion kernel/model/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -1944,6 +1944,8 @@ func exportMarkdownContent0(tree *parse.Tree, cloudAssetsBase string, assetsDest
})
}

currentDocDir := path.Dir(tree.HPath)

var unlinks []*ast.Node
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering {
Expand Down Expand Up @@ -1979,11 +1981,17 @@ func exportMarkdownContent0(tree *parse.Tree, cloudAssetsBase string, assetsDest
var href string
bt := treenode.GetBlockTree(defID)
if nil != bt {
href += strings.TrimPrefix(bt.HPath, "/") + ".md"
href += bt.HPath + ".md"
if "d" != bt.Type {
href += "#" + defID
}
if tree.ID == bt.RootID {
href = "#" + defID
}
}
href = strings.TrimPrefix(href, currentDocDir)
href = util.FilterFilePath(href)
href = strings.TrimPrefix(href, "/")
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: href}
blockRefLink.KramdownIAL = n.KramdownIAL
n.InsertBefore(blockRefLink)
Expand Down
20 changes: 10 additions & 10 deletions kernel/util/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,16 @@ func FilterFilePath(p string) (ret string) {
}

func FilterFileName(name string) string {
name = strings.ReplaceAll(name, "\\", "")
name = strings.ReplaceAll(name, "/", "")
name = strings.ReplaceAll(name, ":", "")
name = strings.ReplaceAll(name, "*", "")
name = strings.ReplaceAll(name, "?", "")
name = strings.ReplaceAll(name, "\"", "")
name = strings.ReplaceAll(name, "'", "")
name = strings.ReplaceAll(name, "<", "")
name = strings.ReplaceAll(name, ">", "")
name = strings.ReplaceAll(name, "|", "")
name = strings.ReplaceAll(name, "\\", "_")
name = strings.ReplaceAll(name, "/", "_")
name = strings.ReplaceAll(name, ":", "_")
name = strings.ReplaceAll(name, "*", "_")
name = strings.ReplaceAll(name, "?", "_")
name = strings.ReplaceAll(name, "\"", "_")
name = strings.ReplaceAll(name, "'", "_")
name = strings.ReplaceAll(name, "<", "_")
name = strings.ReplaceAll(name, ">", "_")
name = strings.ReplaceAll(name, "|", "_")
name = strings.TrimSpace(name)
name = gulu.Str.RemoveInvisible(name) // Remove invisible characters from file names when uploading assets https://github.com/siyuan-note/siyuan/issues/11683
return name
Expand Down

0 comments on commit 9860fc7

Please sign in to comment.