# 如何处理带空行的导入Spoiler？

**URL:** <https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819>\
**Category:** Support\
**Created:** [2019年一月29日 11:58 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819 "2019-01-29T11:58:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)\
**Post date:** [2019年一月29日 11:58 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819/1 "2019-01-29T11:58:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2019年一月29日 12:07 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819/2 "2019-01-29T12:07:35Z")

</div>

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

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

```

And they lived happilly  
ever after  
  ❤

---

<div class="post-metadata">

**Author:** ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)\
**Post date:** [2019年一月29日 12:11 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819/3 "2019-01-29T12:11:47Z")

</div>

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](http://leaflet.iftechfoundation.org/t/cragne-manor-complete-guide-and-walkthrough/14020/22) (test server, won’t last forever)

---

<div class="post-metadata">

**Author:** ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)\
**Post date:** [2019年一月29日 13:29 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819/4 "2019-01-29T13:29:41Z")

</div>

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

```plaintext
[spoiler]
foo

bar
[/spoiler]

```

foo

bar

---

<div class="post-metadata">

**Author:** ![Dannii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dannii/32/129087_2.png) [@Dannii](https://meta.discourse.org/u/Dannii)\
**Post date:** [2019年一月29日 20:48 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819/5 "2019-01-29T20:48:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2019年二月28日 20:48 UTC](https://meta.discourse.org/t/how-to-best-handle-imported-spoilers-with-blank-lines/107819/6 "2019-02-28T20:48:42Z")

</div>

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