diff --git a/titlecase.php b/titlecase.php index b2929e0..323e823 100644 --- a/titlecase.php +++ b/titlecase.php @@ -7,7 +7,7 @@ function titleCase ($title) { //remove HTML, storing it for later // HTML elements to ignore | tags | entities - $regx = '/<(code|var)[^>]*>.*?<\/\1>|<[^>]+>|&\S+;/'; + $regx = '/<(code|var)[^>]*>.*?<\/\1>|<[^>]+>|&\S+;|(#+ )/'; preg_match_all ($regx, $title, $html, PREG_OFFSET_CAPTURE); $title = preg_replace ($regx, '', $title); @@ -56,4 +56,4 @@ function titleCase ($title) { return $title; } -?> \ No newline at end of file +?>