Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 希望笔记同步时按原文同步,而不要自动转码 #744

Closed
1 task done
HIEROT opened this issue Oct 11, 2023 · 11 comments
Closed
1 task done

[Feature] 希望笔记同步时按原文同步,而不要自动转码 #744

HIEROT opened this issue Oct 11, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request stale

Comments

@HIEROT
Copy link

HIEROT commented Oct 11, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Environment

  • OS: Win 11 22H2
  • Zotero Version:
  • Plugin Version: 1.0.4

Describe the feature request

MarkDown格式笔记同步时似乎自动将链接转化为URL的百分号编码导致一些非预期行为
例如Obsidian中内链的格式使用了空格,^,或#等,都会被转化为%XX从而导致在那边不再可用

Describe the solution you'd like

希望同步笔记时按文本原样,而不是自动转码

Anything else?

No response

@HIEROT HIEROT added the enhancement New feature or request label Oct 11, 2023
@HIEROT HIEROT changed the title [Feature] [Feature] 希望笔记同步时按原文同步,而不要自动转码 Oct 11, 2023
@HIEROT
Copy link
Author

HIEROT commented Oct 11, 2023

稍微看了下代码,应该是在md2note中的md2remark时转化了这些链接,不过再一次同步过去的时候这些链接却没有转回原来的文本

@HIEROT
Copy link
Author

HIEROT commented Oct 11, 2023

可能需要在remark2md中进行一些处理?谢谢作者!

@windingwind
Copy link
Owner

请提供样例截图

@HIEROT
Copy link
Author

HIEROT commented Oct 11, 2023

例如首先在Obsidian中输入这样的链接

屏幕截图 2023-10-11 191505

接下来在Zotero Better Notes中使用同步(手动或自动),在Obsidian那边看来文件就会变成这样
屏幕截图 2023-10-11 191552

不仅将Wiki格式链接转化成了标准MarkDown格式(这个问题不大,但是希望也不要改变最好),还把编码改成了百分号编码

@kl2111

This comment was marked as off-topic.

@windingwind

This comment was marked as off-topic.

@HIEROT
Copy link
Author

HIEROT commented Oct 22, 2023

我在Zotero Integration (是一款Obsidian插件)中看到了很好的转化方式
image
也就是在md文件这边只保留链接样式,在从md文件向note同步时,由better-notes插件识别这些链接,如果是Zotero内部item链接再提取item信息转化为Zotero内部链接,而不是把这些信息也变成html样式留在md文件内,如下图这样,会不会更好呢?
image
至于升级时的兼容性问题也很好解决,因为如果note更新的话是完全覆盖md的,因此只需在changelog中告诉大家先修改note并同步即可。

@HIEROT
Copy link
Author

HIEROT commented Oct 24, 2023

关于原问题找到一个Alternative,就是将ExportMDFileContent模板改为

${{
  return mdContent.replace("\\\[\\\[","[[");
}}$

即可

@windingwind
Copy link
Owner

也就是在md文件这边只保留链接样式,在从md文件向note同步时,由better-notes插件识别这些链接,如果是Zotero内部item链接再提取item信息转化为Zotero内部链接,而不是把这些信息也变成html样式留在md文件内,如下图这样,会不会更好呢?

单个citation中可能引用多个条目,还带有页码、前后缀等等信息,ob int的做法在这些情况下会丢失信息,因为一个z链接只包含单个条目的信息。

我可以设想的一个妥协方案是,由BN在zo中支持一种新的链接类型(例如zotero://bn-data),将所有现在以富文本形式在markdown中保存的信息,放入单个链接(但可能会很长),由此可将各类信息全部集中在一个链接中。

另外关于同步时的优先级,也并非笔记优先或md优先,而是最新更改的一处优先。因此很难保证升级时的兼容性,会需要进行一次覆盖所有md的同步

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 14, 2023
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants