Last active
January 10, 2016 23:30
-
-
Save robinsloan/caa5fa173f540d2a0337 to your computer and use it in GitHub Desktop.
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
// for functions.php | |
function em_dash_filter($content) { | |
# add to css: .nobr { whitespace: nowrap; } | |
return preg_replace('/(\w+)(—|—|—)/', '<span class="nobr">$1$2</span><wbr>', $content); | |
} | |
add_filter( "the_content", "em_dash_filter" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like things that work everywhere, forever! Changed!