Skip to content

Improve parsing of YAML Front Matter when importing Markdown #12962

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

Closed
3 tasks done
AdachiQ opened this issue Oct 29, 2024 · 4 comments
Closed
3 tasks done

Improve parsing of YAML Front Matter when importing Markdown #12962

AdachiQ opened this issue Oct 29, 2024 · 4 comments
Assignees
Milestone

Comments

@AdachiQ
Copy link

AdachiQ commented Oct 29, 2024

导入markdown文档时yaml区里的属性导入不正确

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

把思源的一个文档导出为markdown文件,文档的标签输出到了markdown文件的yaml区,导入该md文件,tags变成了自定义属性
思源笔记原文档:
image
导出后的md文件:
image
导入md后生成的文档:
image

Expected result

  • tags应导入为文档标签,而不是文档自定义属性。
  • date应作为文档的创建时间,而不是文档自定义属性。
  • lastmod应作为文档的更新时间,而不是文档自定义属性。
  • 有title属性时,应将title作为文档名,忽略文件名。
    别名、命名、书签、备注等内置属性也应进行特殊处理。

Screenshot or screen recording presentation

No response

Version environment

- Version: 3.1.10
- Operating System: win10
- Browser (if used):

Log file

More information

No response

@AdachiQ AdachiQ changed the title 导入markdown文档时yaml区里的tags导入不正确 导入markdown文档时yaml区里的属性导入不正确 Oct 29, 2024
@88250 88250 changed the title 导入markdown文档时yaml区里的属性导入不正确 Improve parsing of YAML when importing Markdown Oct 29, 2024
@88250 88250 self-assigned this Oct 29, 2024
@88250 88250 changed the title Improve parsing of YAML when importing Markdown Improve parsing of YAML Front Matter when importing Markdown Oct 29, 2024
@88250
Copy link
Member

88250 commented Oct 30, 2024

别名、命名、书签、备注等内置属性也应进行特殊处理。

这个不考虑了,导入 Markdown 主要用于其他应用数据导入,思源自身的数据导出导入最好使用 .sy 而不是 .md。

@TCOTC
Copy link
Contributor

TCOTC commented Oct 30, 2024

这是为了方便将其他软件导出的 Markdown 迁移到思源,而不是为了从思源导出 Markdown 再导入。

在导入思源前用脚本处理一下 Markdown 就可以方便地为文档添加内置属性:别名、命名、书签、备注。

@88250 88250 added this to the 3.1.11 milestone Oct 30, 2024
88250 added a commit that referenced this issue Oct 30, 2024

Verified

This commit was signed with the committer’s verified signature.
88250 added a commit that referenced this issue Oct 30, 2024

Verified

This commit was signed with the committer’s verified signature.
@88250 88250 closed this as completed Oct 30, 2024
88250 added a commit that referenced this issue Nov 5, 2024

Verified

This commit was signed with the committer’s verified signature.
@UltramarineSky
Copy link

UltramarineSky commented Feb 1, 2025

在导入思源前用脚本处理一下 Markdown 就可以方便地为文档添加内置属性:别名、命名、书签、备注。

请问这个是要怎么样处理

@TCOTC
Copy link
Contributor

TCOTC commented Feb 1, 2025

你可以导出看看 别名、命名、书签、备注 的格式,怎么处理问 AI 就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants