Skip to content

Instantly share code, notes, and snippets.

@julienreszka
Last active April 1, 2023 18:38
Show Gist options
  • Save julienreszka/bcd15ca96154580aef84f84f1bd61274 to your computer and use it in GitHub Desktop.
Save julienreszka/bcd15ca96154580aef84f84f1bd61274 to your computer and use it in GitHub Desktop.
javascript:(function() { const regex = /\b(\w{1,3}|\w{4,})/g; const paragraphs = document.getElementsByTagName('p'); for (let i = 0; i < paragraphs.length; i++) { const paragraph = paragraphs[i]; paragraph.innerHTML = paragraph.innerHTML.replace(regex, match => `<b>${match.substr(0,3)}</b>${match.substr(3)}`); }})();
@julienreszka
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment