Get ruby-bbcode-to-md to ignore [quote]

AI-generated summary

The ruby-bbcode-to-md library is breaking the conversion of BBcode [quote] tags into Discourse [quote="username,post:<post_number>, topic:<topic_id>] tags. pfaffman has been avoiding using the library and instead replacing tags manually. neil, the library’s author, suggested forking and modifying the library. However, techAPJ discovered that the library already has a feature to blacklist selected tags, including [quote], which can be achieved by using xyz.bbcode_to_md(false, {}, :disable, :quote). This solution has been applied to the import script base libraries.

I’m doing some work on the xenforo importer and have modified it so that it converts the BBcode [quote] tags into Discourse [quote="username,post:<post_number>, topic:<topic_id>] tags, but ruby-bbcode-to-md breaks it since it doesn’t know how awesome those [quote]s are.

My solution has mostly been to just not use @neil’s ruby-bbcode-to-md (GitHub - nlalonde/ruby-bbcode-to-md: Convert BBCode to Markdown. · GitHub) and just piecemeal replace tags in the importer. This seems sucky (but I think it’s good enough)

Should I fork the library and try to get it to ignore those quotes? Should there be a way to get the library to know to ignore those? (Seems like a regex nightmare to me).

I haven’t looked at that library in a very long time… Fork and hack away.

I ran into same issue when doing a vBulletin bulk import.

Looking into source code there is a way to blacklist selected tags. Here is what you are looking for if you want to blacklist/ignore [quote] tags:

xyz.bbcode_to_md(false, {}, :disable, :quote)

I applied the above fix to import script base libraries as per:

https://github.com/discourse/discourse/commit/71a5369fef33f2d8d3b1d5420a5a6e775c439b0d