Kenshin / simpread

简悦 ( SimpRead ) - 让你瞬间进入沉浸式阅读的扩展
http://ksria.com/simpread
GNU General Public License v3.0
7.92k stars 530 forks source link

与logseq配置后,logseq内标注无法更新到logseq里 #5484

Open RuishiWang opened 1 year ago

RuishiWang commented 1 year ago

描述这个错误

按照教程完成后,在web里的标注能正常同步到logseq,但logseq里打开文章进行编辑却无法同步。 再进入web编辑返回logseq后,logseq中会显示两次先前logseq内进行却没有显示的批注。 另外logseq中的批注没有颜色,不知道是哪里出错了?

复现步骤

按照这篇教程https://github.com/Kenshin/simpread-configs/blob/main/logseq@md/Getting%20Started.md 配置完尝试在logseq内标注,但不显示。同时标注没有颜色

image

其他相关说明

谢谢

操作系统

macOS

浏览器

Chrome

发生问题的网址

https://github.com/Kenshin/simpread-configs/blob/main/logseq@md/Getting%20Started.md

Kenshin commented 1 year ago

@lyserenity

大佬抽时间帮忙看看。

lyserenity commented 1 year ago

你的意思是:你在右边标注,然后左边没有显示,以及没有显示高亮的颜色?

p.s. 我从你图片左边的内容发现应该是模版有问题,你先使用我在下方留言的新模版试试,如果还是有问题,再麻烦你反应...

lyserenity commented 1 year ago

@lyserenity

大佬抽时间帮忙看看。

https://github.com/Kenshin/simpread/discussions/2153#discussioncomment-2627315

这个链接里的模版是错的,之前有个出问题的跟这个一样,不知道是不是因为没更到,麻烦帮忙改一下:

image

正确的「标注」模版如下:

<%
let colors = [ '#B4D9FB', '#ffeb3b', '#a2e9f2', '#a1e0ff', '#a8ea68', '#ffb7da' ],
    color  = colors[ annote.color ];
%>
## [📌](<{{an_int_uri}}>) Highlights {{an_tags}}
> [:p {:style "background-color:<%= color %>"} "{{an_text}}"]
<% if (annote.note) { %>
>> {{an_note}}
<% } %>
### reference
<%- (annote.refs)? "> refs: " + annote.refs : "" %>

> backlinks: {{an_backlinks}}
RuishiWang commented 1 year ago

用了您提供的新模版问题已经解决了。刚开始换完还是不行,之后logseq里刷新就能正常显示了,感谢

Kenshin commented 1 year ago

https://github.com/Kenshin/simpread/issues/5484#issuecomment-1517466525

我明天看下,应该更新看才对…

RuishiWang commented 1 year ago

另外还有个问题就是我如果批注图片的话,logseq中显示的是图片的链接,不是图片本身。这也是标注代码的问题吗 image

lyserenity commented 1 year ago

不是代码有 bug,是标注代码质量的问题 😂:代码里必须判断该高亮是否是图片。

如果是图片就采用 markdown 里适用图片的格式,如果是文字就用高亮:

<%
let colors = [ '#B4D9FB', '#ffeb3b', '#a2e9f2', '#a1e0ff', '#a8ea68', '#ffb7da' ],
    color  = colors[ annote.color ];
%>
## [📌](<{{an_int_uri}}>) Highlights {{an_tags}}
> <%- (annote.type == 'img')? "[img]" + "(" + annote.text + ")" : '[:p {:style "background-color:' + color + '"} ' + '"' + annote.text + '"]' %>
<% if (annote.note) { %>
>> {{an_note}}
<% } %>
### reference
<%- (annote.refs)? "> refs: " + annote.refs : "" %>

> backlinks: {{an_backlinks}}

如果图片你也想用高亮,那你再反应好了....