Skip to content

Commit d580584

Browse files
committed
Cross-platform line-break removal
See #114
1 parent 2639953 commit d580584

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/runner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ function export_docblock( $element ) {
120120
}
121121

122122
$output = array(
123-
'description' => str_replace( "\n", ' ', $docblock->getShortDescription() ),
124-
'long_description' => str_replace( "\n", ' ', $docblock->getLongDescription()->getFormattedContents() ),
123+
'description' => preg_replace( '/[\n\r]+/', ' ', $docblock->getShortDescription() ),
124+
'long_description' => preg_replace( '/[\n\r]+/', ' ', $docblock->getLongDescription()->getFormattedContents() ),
125125
'tags' => array(),
126126
);
127127

128128
foreach ( $docblock->getTags() as $tag ) {
129129
$t = array(
130130
'name' => $tag->getName(),
131-
'content' => str_replace( "\n", ' ', $tag->getDescription() ),
131+
'content' => preg_replace( '/[\n\r]+/', ' ', $tag->getDescription() ),
132132
);
133133
if ( method_exists( $tag, 'getTypes' ) ) {
134134
$t['types'] = $tag->getTypes();

0 commit comments

Comments
 (0)