Skip to content

Commit

Permalink
Escape text with newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandresalome committed Apr 18, 2024
1 parent 7419d66 commit 93ffbea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Output/DotEscaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ private function needsEscaping(string $value): bool
return true;
}

return preg_match('/[{}<> "#\-:\\\\\\/.,]/', $value) || '' === $value;
return preg_match('/[\n{}<> "#\-:\\\\\\/.,]/', $value) || '' === $value;
}
}
1 change: 1 addition & 0 deletions tests/Output/DotEscaperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function provideEscape(): array
['edge', '"edge"'],
['', '""'],
['2', '2'],
["foo\nbar", "\"foo\nbar\""],
];
}

Expand Down

0 comments on commit 93ffbea

Please sign in to comment.