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

autoSpacing not working #76

Closed
Ahdw opened this issue Jan 21, 2022 · 4 comments · Fixed by #92
Closed

autoSpacing not working #76

Ahdw opened this issue Jan 21, 2022 · 4 comments · Fixed by #92
Labels
help wanted Extra attention is needed

Comments

@Ahdw
Copy link

Ahdw commented Jan 21, 2022

autospacing

我给文章部分加上了 heti class,可以看到 heti--classic 的样式生效了。

按照说明,我在 </body>之前加上了增强脚本的调用,可是却没有生效。

<heti-adjacent class="heti-adjacent-half"></heti-adjacent> 没有自动插入标点符号之间。
html
punctualation

在 Chrome 和 Safari 上都没有生效。

@sivan
Copy link
Owner

sivan commented Jan 23, 2022

entry 里的内容是动态渲染的吗?

@sivan sivan added the help wanted Extra attention is needed label Jan 23, 2022
@shikelong
Copy link

The same issue.

Tech Stack: Gatsby / React

I try execute autoSpacing in Console. But It not work.

image

image

image

Chrome version: Version 97.0.4692.71 (Official Build) (arm64) on M1

@Ahdw
Copy link
Author

Ahdw commented Jan 27, 2022

@sivan 是 Hexo 的主题,我在这一行下面加了引用脚本的line:
Snipaste_2022-01-27_21-45-55

Issue 最上面的截图显示,编译出的 html 看起来是正确的,但是 auto spacing 却没有生效。我自己也不清楚这算不算你说的「动态渲染」

@hyrious
Copy link
Contributor

hyrious commented Jun 15, 2022

<script> 不能同时包含 src 和内容,当同时存在时只有 src 会生效。

另外 autoSpacing 使用了 DOMContentLoaded,在页面加载完后监听这个事件也什么都不会发生。如有需要可以手动执行:

let heti = new Heti()
heti.spacingElements(document.querySelectorAll(heti.rootSelector))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants