Ruby-bbcode-to-md gem is a code mangler

Warning to Users of the Ruby gem ruby-bbcode-to-md

The Discourse plugin ruby-bbcode-to-md maintained by Neil Lalonde on GitHub is a total code mangler.

Here are the details from the

.gemspec
 file:$:.push File.expand_path("../lib", __FILE__)

# Maintain your gem's version:
require "ruby-bbcode-to-md/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
  s.name        = "ruby-bbcode-to-md"
  s.version     = RubyBbcode::VERSION
  s.authors     = ["Maarten Bezemer", "Rikki Tooley"]
  s.email       = ["maarten.bezemer@gmail.com", "rikki@inflatablefriends.co.uk"]
  s.homepage    = "https://github.com/rikkit/ruby-bbcode-to-md"
  s.summary     = "ruby-bbcode-to-md-#{s.version}"
  s.description = "Convert BBCode to Markdown and check whether the BBCode is valid."

  s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
  s.test_files = Dir["test/**/*"]

  s.add_dependency 'activesupport'
  s.add_development_dependency 'rake'
  s.add_development_dependency 'pry'
end

Yesterday, I confirmed this mangling. Here are some examples:

cat test.rb
require 'ruby-bbcode-to-md'
hello = "[[ $string2 =~ ROS[0-9]+$ ]] && echo OK || echo NOK".bbcode_to_md
puts hello

ruby test.rb
$string2 =~ ROS[0-9]+$ ]] && echo OK || echo NOK

You can easily see that 'ruby-bbcode-to-md' completely mangles the code fragment, stripping away all left square brackets.

Here is another example:

$ cat test.rb
require 'ruby-bbcode-to-md'
hello = 'for key in "${!aa[@]}"'.bbcode_to_md
puts hello
$ ruby test.rb
for key in "${!aa@]}"

Here is my recent post on this situation over at our new Community site:

Yesterday, when I posted this serious issue on meta, even though completely confirmed as a bug, I was shut down and my bug report deleted by the maintainer of the plugin.

This is the first time in four decades of technical work have I experienced such heavy-handed tactics by a software developer / repo maintainer.

Covering up serious bugs and shutting down bug reports is bad for all migrators out there who might use this plugin.

Reference: PDF copy of original bug report before closed and deleted.

https://www.unix.com/pdf/Ruby-bbcode-to-md_deleted_bug_report_meta_discourse.pdf
2 Likes