Last active
March 20, 2020 22:53
-
-
Save benjaminsehl/6edc7615279553487149db9427fa4688 to your computer and use it in GitHub Desktop.
An ES6 function for fixing Orphans
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
export function adopt(str) { | |
return str.replace(/\s([^\s<]+)\s*$/g, '\u00A0$1'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment