In a discussion about handling imported spoilers with blank lines during a phpBB3-to-Discourse migration, Dannii reports that the discourse-spoiler-alert plugin fails to detect multi-line spoilers containing blank lines. They consider converting [spoiler] tags to [details="Spoiler"] or using the “ruby-bbcode-to-md” import option, though the latter doesn’t support [spoiler]. zogstrip initially notes that multi-line spoilers work, but Dannii clarifies the issue specifically involves blank lines within the spoiler block. gerhard explains that blank lines inside [spoiler] tags are supported only if the [spoiler] and [/spoiler] tags each occupy their own line — demonstrated with a working example. Dannii confirms understanding and notes that similar formatting rules apply to [code] tags, meaning both will require rewriting to comply with Discourse’s parsing rules. The thread highlights a formatting nuance in Discourse’s BBCode handling: tags must be isolated on their own lines to properly parse content with internal 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.