Skip to content

Instantly share code, notes, and snippets.

@AWare
Created November 29, 2017 15:41
Show Gist options
  • Select an option

  • Save AWare/8dbf985fd753f411cb380fece559b80e to your computer and use it in GitHub Desktop.

Select an option

Save AWare/8dbf985fd753f411cb380fece559b80e to your computer and use it in GitHub Desktop.
my bad hack
[...document.querySelectorAll('p,span,a,h1,h2,h3')].filter(e =>e.textContent.length > 140 ).map((p,n) => {
p.textContent = p.textContent.substring(0,(140 + 140 * Math.pow(Math.E,(-n/4))))
})
[...document.querySelectorAll('p,span,a,h1,h2,h3')].filter(e =>e.textContent.length > 10 ).map((p,n) => { p.textContent = "tldr;" });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment