Skip to content

Commit

Permalink
remove whitespace from start and end of post
Browse files Browse the repository at this point in the history
  • Loading branch information
benlk committed Jul 25, 2018
1 parent 8c4ad0f commit 79ab088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/post-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function largo_remove_hero( $content ) {
$minus_image = str_replace( $matches[0], '', $content );
// remove leading <p></p> tag, even if it contains HTML attributes,
// but not if it's not empty
return preg_replace( '/^<p[^>]?><\/p>/m', '', $minus_image, 1 );
return trim( preg_replace( '/^<p[^>]?><\/p>/m', '', $minus_image, 1 ) );
}

return $content;
Expand Down

0 comments on commit 79ab088

Please sign in to comment.