sivan / heti

赫蹏(hètí)是专为中文内容展示设计的排版样式增强。它基于通行的中文排版规范而来,可以为网站的读者带来更好的文章阅读体验。
https://sivan.github.io/heti/
MIT License
5.92k stars 251 forks source link

Bug:多个符号的情况下出现错位 #117

Closed devhaozi closed 2 months ago

devhaozi commented 2 months ago

使用 0.9.4 版本的 Heti

问题如图:

image

HTML结构如下:

<p dir="auto"><heti-spacing class="heti-spacing-start">Discourse</heti-spacing>官方已经为这些模型打包好了<heti-spacing class="heti-spacing-start heti-spacing-end">Docker</heti-spacing>镜像,所以我们可以很轻松地在服务器上运行模型。<br>
注意:支持中文的嵌入模型<code>multilingual-e5-small</code>特别占内存(在我这里容器占用了<heti-spacing class="heti-spacing-end">30 G+</heti-spacing><heti-adjacent class="heti-adjacent-half"><heti-adjacent class="heti-adjacent-half"><heti-adjacent class="heti-adjacent-half"><heti-adjacent class="heti-adjacent-half">)</heti-adjacent></heti-adjacent></heti-adjacent></heti-adjacent>,其他容器占用约<heti-spacing class="heti-spacing-start heti-spacing-end">2 G /</heti-spacing>个。</p>

可以发现<heti-adjacent class="heti-adjacent-half">被重复添加了 4 次,导致此问题。

devhaozi commented 2 months ago

我优化了 JS,避免重复调用 autoSpace,问题解决。