# Is it OK to just require bbcode-to-md in importers?

**URL:** https://meta.discourse.org/t/is-it-ok-to-just-require-bbcode-to-md-in-importers/70541
**Category:** Development
**Created:** [Septembre 21, 2017, 10:36 UTC](https://meta.discourse.org/t/is-it-ok-to-just-require-bbcode-to-md-in-importers/70541 "2017-09-21T22:36:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [Septembre 21, 2017, 10:36 UTC](https://meta.discourse.org/t/is-it-ok-to-just-require-bbcode-to-md-in-importers/70541/1 "2017-09-21T22:36:11Z")

</div>

**TL;DR:** When I submit a PR for `vbulletin.rb` (I added support for assigning admins and moderators, and maybe something else), can I include code that requires `ruby-bbcode-to-md` so that it just works?

### Painful Explanation

I’ve been running and writing importers for about a year now and this is the first time that I’ve managed to include `ruby-bbcode-to-md`.

When I follow these directions I get some kind of version error:

> <https://github.com/discourse/discourse/blob/main/script/import_scripts/base.rb#L1-L12>

If I instead do this:

```plaintext
  puts "echo gem \\'ruby-bbcode-to-md\\' >> Gemfile"
  puts "bundle install"

```

and

```plaintext
@bbcode_to_md = true
  require 'ruby-bbcode-to-md'

```

It works. And there’s no mention of the bbcode-to-me command line argument in `vbulletin.rb`, so unless someone running the script instinctively reads `base.rb`, they don’t have much chance of knowing about that. And the importer is pretty much broken without it.

Wait, there is this comment ` # convert *-tags to li-tags so bbcode-to-md can do its magic on phpBB's lists:` but even then, there’s no hint how to make that happen.

---

<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: [Septembre 22, 2017, 10:07 UTC](https://meta.discourse.org/t/is-it-ok-to-just-require-bbcode-to-md-in-importers/70541/2 "2017-09-22T22:07:37Z")

</div>

It’s already in the `Gemfile`. 😉

> <https://github.com/discourse/discourse/blob/main/Gemfile#L189-L194>

Just set the environment variable `IMPORT=1` before your run `bundle install` or execute the import script.
