I need change background of all text that have two spaces from the start of the line.
text
shold be converted to "<div class='special'>text</div>
"
That is easy:
$text = preg_replace("|^ (.+)|um", "<div class='special'>$1</div>", $text);
But
line1
line2
Is converted to
<div class='special'>line1</div>
<div class='special'>line2</div>
Though
<div class='special'>line1
line2</div>
is needed.
How that can be achieved?