How to best handle imported spoilers with blank lines?

I’m migrating a phpBB3 forum, and have a lot of posts using [spoiler] tags. I’ve tired the discourse-spoiler-alert plugin, but it doesn’t detect multi-line spoilers with blank lines. Is there a way to make it do that, or is there a way to transform [spoiler] into [details="Spoiler"]?

I haven’t tried the “ruby-bbcode-to-md” import option yet. I might try that when I test the migration again. Actually, looks like it doesn’t support [spoiler] anyway.

Do you have specific examples? Because [spoiler] works with multilines

And they lived [spoiler] happilly
ever after
[/spoiler] :heart:

And they lived happilly
ever after
:heart:

Sorry, it’s multi-line with blank lines. Here’s an example of a post with working and non-working spoiler tags:

http://leaflet.iftechfoundation.org/t/cragne-manor-complete-guide-and-walkthrough/14020/22 (test server, won’t last forever)

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

4 Likes

Ah, okay, thanks for clearing that up. I’ve noticed that [code] also won’t work if it isn’t on a line by itself, so I’ll have to rewrite both.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.