commit 39bf67b6ea4910610627b111694d1ed55b829dcd Author: OverPoweredDev Date: Tue Jun 22 13:40:54 2021 +0530 updated regex used to separate words I hate regex so much diff --git a/src/content/hover.js b/src/content/hover.js index 628fdfe..619490b 100644 --- a/src/content/hover.js +++ b/src/content/hover.js @@ -3,14 +3,8 @@ function addHoverTag() { console.log("hi") $('p').each(function() { let $this = $(this); - $this.html($this.text().replace(/\b(\w+)\b/g, "$1")); + $this.html($this.text().replace(/(?]*|&[^;]*))([^\s<]+)/g, '$1$2')); }); }); - - // bind to each hover - $('hover').hover( - function() { $('#word').text($(this).css({"background-color":"#b4b4b4", "transition-delay":".5s"}).text()); }, - function() { $('#word').text(''); $(this).css('background-color',''); } - ); } \ No newline at end of file