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

特殊的 dom 结构会导致 HighlightSource 计算错误。 #99

Open
DiamondYuan opened this issue Apr 14, 2022 · 2 comments
Open

特殊的 dom 结构会导致 HighlightSource 计算错误。 #99

DiamondYuan opened this issue Apr 14, 2022 · 2 comments

Comments

@DiamondYuan
Copy link

DiamondYuan commented Apr 14, 2022

<p>123</p>
<p><b>345</b></p>

getTextPreOffset(p,b) 的计算结果是错误的。

@DiamondYuan
Copy link
Author

一开始 end 是 { node: P: ,offset: 0 }
经过 formatDomNode 计算后变成了 {$node: B , 0 }

@DiamondYuan
Copy link
Author

DiamondYuan commented Apr 14, 2022

if ($curNode.nodeType === 3 && $curNode !== $text) {

当 $node = B 、I 的时候。 n.$node.nodeType === 1

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

1 participant