Skip to content

Instantly share code, notes, and snippets.

@meeDamian
Last active March 27, 2017 09:34
Show Gist options
  • Save meeDamian/bba3730248d2bac16f8bd33bb2be35db to your computer and use it in GitHub Desktop.
Save meeDamian/bba3730248d2bac16f8bd33bb2be35db to your computer and use it in GitHub Desktop.
<html>
<head>
<!-- useless crap goes here… -->
</head>
<body>
<!-- some more of the useless crap… -->
<!-- … -->
<script>
// use this if you only support non-retarded browsers
$(() => document.body.innerHTML = document.body.innerHTML.replace(/\s(\w)\s/g, ' $1&nbsp;'));
</script>
</body>
</html>
<html>
<head>
<!-- useless crap goes here… -->
</head>
<body>
<!-- some more of the useless crap… -->
<!-- … -->
<script>
// use this if you also need to support retarded browsers
$(function() {
document.body.innerHTML = document.body.innerHTML.replace(/\s(\w)\s/g, ' $1&nbsp;');
});
</script>
</body>
</html>
<html>
<head>
<!-- useless crap goes here… -->
</head>
<body>
<!-- some more of the useless crap… -->
<!-- … -->
<script>
// use this if you also need to support retarded browsers
$(function() {
document.body.innerHTML = document.body.innerHTML.replace(/\s(\w)\s/g, ' $1&nbsp;').replace(/(dr|prof\.)\s/gi, '$1&nbsp;');
});
</script>
</body>
</html>
document.body.innerHTML = document.body.innerHTML.replace(/\s(\w)\s/g, ' $1&nbsp;').replace(/(dr|prof\.)\s/gi, '$1&nbsp;');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment