alienzhou / web-highlighter

✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️
https://alienzhou.github.io/web-highlighter/
MIT License
888 stars 144 forks source link

Breaks table columns #94

Open mrtronje opened 2 years ago

mrtronje commented 2 years ago

Hi The highlighter doesn't work across table columns, see

image

mortenpless commented 2 years ago

Upvote this issue!

zcf0508 commented 1 year ago

可以试试这样处理

highlighter.hooks.Render.SelectedNodes.tap((id, nodes) =>{
  const filteredNodes =  nodes.filter(node => {
    if(node.type == 'text' && node.$node.data.trim() == '') {
      return false;
    }
    return true;
  });
  return filteredNodes;
});