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

提升中文强调文本可读性 #11

Open
queensferryme opened this issue Feb 25, 2021 · 7 comments
Open

提升中文强调文本可读性 #11

queensferryme opened this issue Feb 25, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@queensferryme
Copy link
Owner

queensferryme commented Feb 25, 2021

在中文排版中,通常使用着重号(在文字下加点)来表示强调 <strong>,参见链接

此外,应考虑参考 typo.css 对中文排版做特殊处理,以求改善。

@queensferryme queensferryme self-assigned this Feb 25, 2021
@queensferryme queensferryme added the enhancement New feature or request label Feb 25, 2021
@queensferryme
Copy link
Owner Author

@longfeiss
Copy link

{{ .Summary | replaceRE "<strong>(\\p{Han}+?)</strong>" "<strong class=chinese>$1</strong>" | safeHTML }}

请教一下,为啥要这样写?

对于中英文混排的场景,不就无法通过加点的方式进行强调了吗

@queensferryme
Copy link
Owner Author

对于中英文混排,我的建议是手动将 markdown 拆开:**加粗 bold** -> **加粗** **bold**

@queensferryme
Copy link
Owner Author

之所以用这种比较别扭的方法实现,是因为之前考虑到 README.md 里面承诺过 "No JavaScript"。如果引入 JavaScript 来处理的话应该会更优雅一些。

不过考虑到现在已经有若干功能实质上不得不依赖 JS(例如评论、数学公式),正在考虑有机会用 JS 重写这个功能。README.md 里面的承诺可以改为 "Opt-In JavaScript"。

@queensferryme queensferryme reopened this May 6, 2022
@longfeiss
Copy link

其实可以改为全部加点啊,主要是强调的方式要统一 🤔

@queensferryme
Copy link
Owner Author

着重号是中文排版特有的标点符号,不应该用于英文文本。尤其是英文字体不等宽的时候,加着重号就会显得非常凌乱。如果你有这个需求,可以考虑直接在 custom.css 里面修改 <strong><em> 的 css。

@longfeiss
Copy link

着重号是中文排版特有的标点符号,不应该用于英文文本。尤其是英文字体不等宽的时候,加着重号就会显得非常凌乱。如果你有这个需求,可以考虑直接在 custom.css 里面修改 \<strong\>\<em\> 的 css。

好的,感谢

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

No branches or pull requests

2 participants