Skip to content

Instantly share code, notes, and snippets.

@benjaminsehl

benjaminsehl/adopt.js

Last active Mar 20, 2020
Embed
What would you like to do?
An ES6 function for fixing Orphans
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