Skip to content

Commit 0768e69

Browse files
committed
Merge branch 'dev'
2 parents 8db81cc + 1ceb46a commit 0768e69

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sy-docs-flow",
3-
"version": "0.12.2",
3+
"version": "0.12.3",
44
"type": "module",
55
"description": "",
66
"repository": "",

plugin.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "sy-docs-flow",
33
"author": "frostime",
44
"url": "https://github.com/frostime/sy-docs-flow",
5-
"version": "0.12.2",
6-
"minAppVersion": "3.0.12",
5+
"version": "0.12.3",
6+
"minAppVersion": "3.1.10",
77
"backends": [
88
"all"
99
],

src/components/docs-flow/docs-list.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Author : frostime
44
Date : 2024-10-01 20:33:19
55
FilePath : /src/components/docs-flow/docs-list.svelte
6-
LastEditTime : 2024-10-03 14:26:17
6+
LastEditTime : 2024-11-17 18:41:11
77
Description :
88
99
显示所有的文档
@@ -57,7 +57,7 @@
5757
function scrollToFirstLoadedItem() {
5858
const firstLoadedItem = document.querySelector(".loaded");
5959
if (firstLoadedItem) {
60-
firstLoadedItem.scrollIntoView({ behavior: "smooth" });
60+
firstLoadedItem.scrollIntoView({ behavior: "instant" });
6161
}
6262
}
6363
</script>

src/rules.ts

+22-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author : Yp Z
44
* @Date : 2023-07-29 15:17:15
55
* @FilePath : /src/rules.ts
6-
* @LastEditTime : 2024-06-15 15:46:33
6+
* @LastEditTime : 2024-11-17 18:32:47
77
* @Description :
88
*/
99
import { showMessage, fetchPost } from "siyuan";
@@ -255,10 +255,17 @@ class DocBacklinks extends MatchRule {
255255
let resultIds = [];
256256
for (let backlink of backlinks) {
257257
backlink.backlinks.forEach((item) => {
258-
if (item?.blockPaths) {
259-
const blockPaths = item.blockPaths;
260-
//这个 API 挺好的地方在于会自动处理 li&p 问题
261-
resultIds.push(blockPaths[blockPaths.length - 1].id);
258+
// if (item?.blockPaths) {
259+
// const blockPaths = item.blockPaths;
260+
// //这个 API 挺好的地方在于会自动处理 li&p 问题
261+
// resultIds.push(blockPaths[blockPaths.length - 1].id);
262+
// }
263+
if (item.dom) {
264+
const html = item.dom;
265+
const ele = document.createElement('div');
266+
ele.innerHTML = html;
267+
const id = ele.firstElementChild.getAttribute('data-node-id');
268+
resultIds.push(id);
262269
}
263270
});
264271
}
@@ -307,9 +314,16 @@ class DocBackmentions extends MatchRule {
307314
let resultIds = [];
308315
for (let backmention of backmentions) {
309316
backmention.backmentions.forEach((item) => {
310-
if (item?.blockPaths) {
311-
const blockPaths = item.blockPaths;
312-
resultIds.push(blockPaths[blockPaths.length - 1].id);
317+
// if (item?.blockPaths) {
318+
// const blockPaths = item.blockPaths;
319+
// resultIds.push(blockPaths[blockPaths.length - 1].id);
320+
// }
321+
if (item.dom) {
322+
const html = item.dom;
323+
const ele = document.createElement('div');
324+
ele.innerHTML = html;
325+
const id = ele.firstElementChild.getAttribute('data-node-id');
326+
resultIds.push(id);
313327
}
314328
});
315329
}

0 commit comments

Comments
 (0)