Skip to content

Commit e79e41a

Browse files
committed
fix: use built-in function nl2br
1 parent f722208 commit e79e41a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/LongText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class LongText extends AbstractMultiBaseType {
2525
*/
2626
public function renderValue($value, \Doku_Renderer $R, $mode) {
2727
if ($mode === 'xhtml') {
28-
$valueWithBR = str_replace("\n", '<br>', hsc($value));
28+
$valueWithBR = nl2br(hsc($value));
2929
$R->doc .= hsc($this->config['prefix']) . $valueWithBR . hsc($this->config['postfix']);
3030
} else {
3131
$R->cdata($this->config['prefix'] . $value . $this->config['postfix']);

0 commit comments

Comments
 (0)