Created
September 8, 2014 02:38
-
-
Save makzan/4e39b40bf758a1378b44 to your computer and use it in GitHub Desktop.
Orphans Fixer without jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Orphans Fixer | |
all_paragraphs = document.querySelectorAll('p, h1, h2, h3, li') | |
window.p = all_paragraphs[0] | |
reg = /\s([^\s<]{0,10})\s*$/ | |
for p in all_paragraphs | |
p.innerHTML = p.innerHTML.replace reg, " $1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment