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

会高亮实例化根元素以外的元素。 #101

Open
ddddderek opened this issue Jul 11, 2022 · 2 comments
Open

会高亮实例化根元素以外的元素。 #101

ddddderek opened this issue Jul 11, 2022 · 2 comments

Comments

@ddddderek
Copy link

实例化的时候,传入容器根元素。

错误:划线根元素以外的元素,也会导致高亮。

期望:只应该高亮容器根元素的后代节点。

复现:连接 展示的网站也有此问题。

@ahicham-xyz
Copy link

也许这可能会有所帮助,我修复它的方法是在初始化期间设置 exceptSelectors: [] 选项以排除外部元素我还确保用作容器的 DOM 元素已添加到页面中,因为如果找不到它并且它是 等于 null,荧光笔将使用整个文档作为后备。

Maybe this could help, the way I fixed it is by setting the exceptSelectors: [] option during initialisation to exclude external elements also I made sure the DOM element used as container has been added to the page because if it is not found and it is equal to null, the highlighter will use the whole document as fallback.

@qscgu23
Copy link

qscgu23 commented Mar 21, 2023

传入根元素的HTMLElement但是依然会高亮根元素之外的节点

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

3 participants