How to best handle imported spoilers with blank lines?

Blank lines inside the spoiler tag work as long as you make sure that the BBCode tags are on new lines.

[spoiler]
foo

bar
[/spoiler]

foo

bar