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

关于图和表格的说明文字 #3

Open
YangLeiSX opened this issue May 15, 2021 · 1 comment
Open

关于图和表格的说明文字 #3

YangLeiSX opened this issue May 15, 2021 · 1 comment

Comments

@YangLeiSX
Copy link

在现在的版本中,添加的图和表格下面只会显示"图x",“表格x”的字样。
想知道能不能在“图x”后面添加说明文字,例如将markdonw语法中方括号内部的说明文字显示在下方。

@du33169
Copy link
Owner

du33169 commented May 15, 2021

目前不太可行。
<Img>标签不支持目前用于显示“图x”的::after伪元素,目前的版本是把它添加在在编辑时img标签的父元素上,但是导出时父元素并不会被保留,所以“图x”目前还不能显示在导出的文件中;
CSS提供了attr()方法可以获取本元素的属性值,也正是因为实际“图x”是添加在父元素,而说明文字是保存在<img>的alt属性中,所以单从CSS方面可能无论在导出还是编辑时都无法实现显示说明文字。

不过我注意到最近更新的Typora支持导出时添加附加HTML,这实际上提供了在导出时运行JS脚本的支持(似乎官方也有这样的示例),那么就有很多可能性了,我后面再试试。

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

No branches or pull requests

2 participants