Skip to content

Commit

Permalink
excluding textarea(s) from trimming whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
tracend committed Nov 14, 2013
1 parent 23fbb3f commit 15f5817
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ function updateDom($tag, $dom){
}

function trimWhitespace( $string ){
// replace multiple spaces with one
return preg_replace( '/\s+/', ' ', $string );
// replace multiple spaces with one (except textarea)
return preg_replace( '/(?:\s+(?![^<]*<\/textarea>))/', ' ', $string );
}

}
Expand Down

0 comments on commit 15f5817

Please sign in to comment.