Skip to content

Use <sup>/<sub> for Markdown exporting superscript/subscript #11152

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
Achuan-2 opened this issue Apr 26, 2024 · 3 comments
Closed

Use <sup>/<sub> for Markdown exporting superscript/subscript #11152

Achuan-2 opened this issue Apr 26, 2024 · 3 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

Achuan-2 commented Apr 26, 2024

上下标样式导出使用<sup><sub>语法

In what scenarios do you need this feature?

相关isssue:#11141
希望思源笔记把上标和下标样式的输出改为 <sup><sub>
原因

  • 虽然 Markdown 没有统一标准,各家都有各家方言,但是 Github 的 Markdown 语法在一定程度上是可以看作规范的,GFM 上标和下标语法就为 <sup><sub>,而不是^和~,思源笔记的上标和下标样式直接粘贴到 GitHub 是失效的

  • 导出 Markdown 的 上标和下标语法改为 <sup><sub>,大部分主流 Markdown 编辑器都是支持 html 标签解析的,适用性更广

对我接触到的支持Markdown语法的软件和网站进行上下标语法测试

上下标语法支持✅❌ 是否支持<sub><sup>语法 是否支持^~语法
Github 支持 不支持,~包裹的文字会识别为下划线
Typora 支持 可以配置是否支持
VSCode Markdown 支持 默认不支持,需要装Markdown Preview Enhance等插件
Obsidian 支持 默认不支持,不了解插件能否支持
Hexo 支持 默认不支持,需要主题或插件支持
CSDN 支持 支持
语雀 支持导入,不支持输入 支持导入、支持输入
简书 支持 支持
纯纯写作 支持 不支持
简书 支持 支持
博客园 支持 支持
知乎 不支持 不支持
notion 不支持 不支持
flowus 不支持 不支持,~包裹的文字会识别为下划线
wolai 不支持 不支持,~包裹的文字会识别为下划线

测试结果

  • 在本次测试中,支持上下标语法的软件和网站一定支持<sub><sup>语法,但不一定支持^~语法
  • Github、flowus、wolai会把~语法识别为下划线语法
  • 一些网站不支持上下标语法,知乎还会把<sub><sup>标签清除,不会把^~清除。

Describe the optimal solution

  • 导出Markdown时,将上下标样式改为<sup><sub>语法
  • 兼容<sup><sub>上下标语法的输入,便于Markdown格式的直接粘贴
  • 复制Markdown时,上下标样式改为<sup><sub>语法,便于内容粘贴到Github等网站

Describe the candidate solution

Other information

No response

@Achuan-2 Achuan-2 changed the title 上下标语法导出改为<sup><sub>语法 上下标语法导出使用<sup><sub>语法 Apr 26, 2024
@Achuan-2 Achuan-2 changed the title 上下标语法导出使用<sup><sub>语法 上下标样式导出使用<sup><sub>语法 Apr 26, 2024
@88250 88250 changed the title 上下标样式导出使用<sup><sub>语法 Use <sup>/<sub> for Markdown exporting superscript/subscript Apr 26, 2024
@88250 88250 self-assigned this Apr 26, 2024
@88250 88250 added this to the 3.0.12 milestone Apr 26, 2024
@88250
Copy link
Member

88250 commented Apr 26, 2024

兼容上下标语法的输入,便于Markdown格式的直接粘贴

这个暂时不考虑了,需要继续收集需求,谢谢。

88250 added a commit to 88250/lute that referenced this issue Apr 26, 2024

Unverified

This user has not yet uploaded their public signing key.
88250 added a commit that referenced this issue Apr 26, 2024

Unverified

This user has not yet uploaded their public signing key.
@88250 88250 closed this as completed Apr 26, 2024
@Achuan-2
Copy link
Member Author

Achuan-2 commented Apr 26, 2024

这个暂时不考虑了,需要继续收集需求,谢谢。

@88250 好的,暂时不着急,不过其实思源的键盘样式<kbd>、下划线样式<u>都是html标签,兼容<sup><sub>输入也应该是一件理应正常的事情,毕竟现在导出已经改了。

@88250
Copy link
Member

88250 commented Apr 26, 2024

嗯,后续 #11156

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

2 participants