Skip to content

Commit

Permalink
🔖 v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Achuan-2 committed Jul 18, 2024
1 parent f94af18 commit 686f5d8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## 2.1.9 / 2024-07-18
## v2.2.0 / 2024-07-18
✨ link icon 功能优化
- 锚文本为数字不显示 link icon
- 锚文本为*不显示 link icon
- 锚文本被[]包裹,不显示 link icon


## 2.1.8 / 2024-07-17
## v2.1.8 / 2024-07-17
- 💄 优化Dark主题透明图片大图预览
- 💄 优化Dark主题的加粗文字样式:设置为青绿色
- 💄 列表自动加粗
Expand All @@ -15,7 +15,7 @@
- 💄 区分块引的静态锚文本和动态锚文本
- 💄 数据库新增列按钮背景色设置为透明

## 2.1.7 / 2024-05-31
## v2.1.7 / 2024-05-31
- 🐛 尝试修复Linux不显示link icon的问题

## v2.1.6 / 2024-05-29
Expand Down
4 changes: 2 additions & 2 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@

## 🚀最近更新

2.1.9 / 2024-07-18
v2.2.0 / 2024-07-18
✨ link icon 功能优化
- 锚文本为数字不显示 link icon
- 锚文本为*不显示 link icon
- 锚文本被[]包裹,不显示 link icon

2.1.8 / 2024-07-17
v2.1.8 / 2024-07-17
- 💄 优化Dark主题透明图片大图预览
- 💄 优化Dark主题的加粗文字样式:设置为青绿色
- 💄 列表自动加粗
Expand Down
5 changes: 1 addition & 4 deletions style/doc_attr.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
margin: 0 auto;
}

/* 不显示linkicon */
.protyle-wysiwyg[custom-linkicon='no'] [data-node-id] span[data-type~='a']:not(:empty)::before {
display: none !important;
}


/* -------------各级标题 标题自动编号----------------------- */
/* body {
Expand Down
12 changes: 11 additions & 1 deletion style/module/link_icon.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.protyle-wysiwyg [data-node-id] span[data-type~='a']:not([custom-link-icon='true']):not(:empty)::before,
.protyle-wysiwyg [data-node-id] span[data-type~='a']:not(:empty)::before,
.protyle-wysiwyg [data-node-id] span[data-type~='url']:not(:empty)::before,
.av__celltext--url::before,
.b3-typography a:not(:empty)::before,
Expand All @@ -12,6 +12,16 @@
height: 1em;
margin-right: 0.2em !important;
}
/* 文档设置属性:不显示linkicon */
.protyle-wysiwyg[custom-linkicon='false'] [data-node-id] span[data-type~='a']:not(:empty)::before {
display: none !important;
}

/* 让 link icon 根据锚文本来选择是否显示的css片段 */
.protyle-wysiwyg [data-node-id] span[data-type~='a'][custom-linkicon='false']:not(:empty)::before,
.protyle-wysiwyg [data-node-id] a[custom-linkicon='false']:not(:empty)::before{
display: none !important;
}
/* 上标不显示link icon */
.protyle-wysiwyg [data-node-id] span[data-type~='a'][data-type~='sup']:not(:empty)::before{
display: none !important;
Expand Down
8 changes: 5 additions & 3 deletions theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,18 +757,20 @@ function ViewMonitor(event) {
设置思源块属性(id, attrs);
}


function link_icon_filter() {
let spans = document.querySelectorAll('span[data-type="a"]');
spans.forEach(span => {
const isWrappedInBracketsOrNumber = /\[.+?\]|^\d+$/.test(span.textContent);
if (span.textContent === '*' || isWrappedInBracketsOrNumber) {
span.setAttribute('custom-link-icon', 'true');
if (span.textContent === '*' || isWrappedInBracketsOrNumber) {
span.setAttribute('custom-linkicon', 'false');
}
else {
span.removeAttribute('custom-link-icon');
span.removeAttribute('custom-linkicon');
}
});
}
linkIconFilterInterval = setInterval(link_icon_filter, 100);

/**++++++++++++++++++++++++++++++++主题功能执行:按需调用++++++++++++++++++++++++++++++ */
window.theme.timerIds = [];
Expand Down
2 changes: 1 addition & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Tsundoku",
"author": "Achuan-2",
"url": "https://github.com/Achuan-2/siyuan-themes-tsundoku",
"version": "2.1.9",
"version": "2.2.0",
"displayName": {
"default": "Tsundoku",
"zh_CN": "積読"
Expand Down

0 comments on commit 686f5d8

Please sign in to comment.