Sponsored Content
Top Forums Programming Ruby-bbcode-to-md gem is a code mangler Post 303045475 by Neo on Thursday 26th of March 2020 10:44:27 PM
Old 03-26-2020
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
Code:
.gemspec


Code:
 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:

Code:
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:


Code:
$ 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:


Quote:
We have decided to drop, completely, using ruby-bbcode-to-md in the migration process and to perform all of the legacy bbcode transformation in the preprocessing routine in the migration script.

In fact, during my initial test runs, I did not use ruby-bbcode-to-md but there was a lot of forum BBCODE which was not properly transformed; so after days of problems and searching the discourse meta site and other Internet spaces, the only recommended “solution”¯ from Discourse and their users was ruby-bbcode-to-md.

We now know, that this “solution”¯ is seriously flawed. ruby-bbcode-to-md is a mangler.

During my initial test runs, it was obvious that there was another alternative, and that alternative was to greatly modify and enhance the preprocessing routine to do the required bbcode-to-markdown transformations in there.

Basically, the migration script is a kind of kluge of various routines and plugins, because migration is not well supported by Discourse, especially forums which use legacy bbcode.

This is totally understandable, as no one likes migrating legacy data from one system to another. It is perfectly normal for the Discourse team to cringe at this, and they do, believe me. However, in this case I am very disappointed in Discourse team member Neil Lalonde, which I will discuss later. He owes us a big apology but I am sure we will never get one.

In an nutshell, the migration script preprocesses the original post pagetext in two routines. One (the first one) is a Ruby preprocessing routine and the second is a Discourse plugin based on a Ruby gem, ruby-bbcode-to-md , “maintained”¯ by Mr. Lalonde, which we now have confirmed is a serious code mangler.

On that note, I recommend Mr. Lalonde put a big scarlet banner across his GitHub ruby-bbcode-to-md repo; WARNING THIS PLUGIN IS A CODE MANGLER.

Around a week or so ago, I considered, around test run 2, to do all the bbcode to md transformations in the migration in the preprocessing routing in the migration script, but research indicated that the ruby-bbode-to-md plugin worked. I did a lot of research on this and here was no indication this plugin was unsupported, obsolete, or problematic.

So, I decided to go with the Neil Lalonde's ruby-bbode-to-md plugin, which looked like it was well supported. That decision was a mistake. However, now we know. It's time to move on.

Yesterday, I posted this issues over at meta Discourse and Neil Lalonde washed his hands of his plugin, closed and deleted my bug report, even thought the bugs are confirmed and serious. This was quite shocking to see a Discourse team member resort to such heavy-handed tactics when their code repo is proven to be seriously flawed. So forget ruby-bbode-to-md. The repo maintainer has shown his true colors as a developer. He owes us a serious apology but since he is “Leader”¯ status as meta, I'm sure nothing good will come of this. He just shuts me down and deletes my bug reports, I assume to protect his reputation. Shocking and quite unexpected, frankly.

Normally, I never call out any software developer by name, but his heavy-handed and unprofessional behavior yesterday, regarding serious flaws in his own Discourse plugin repo on GitHub, is not acceptable. Other migration teams need to be warned how much of a mangler ruby-bbcode-to-md is. Do not use ruby-bbode-to-md. It does and will mangle text .

On a very positive note:

@Scrutinizer has offered to add the required bbcode to md transistions in the migration script preprocessing routine. This is a cleaner solution (and was one I considered earlier when I was doing all this alone). So, I am very pleased that Jeroen has volunteered to help. He deserves a special badge for that. It's very helpful to have someone else writing code, testing and helping out! Thank you!

Moving forward, we are washing our hands, completely, of ruby-bbode-to-md and I will write some posts to warn other migration teams to avoid ````ruby-bbode-to-md``` like the black plague.

If someone want's to rewrite ruby-bbode-to-md the code mangler, please feel free, but we have what we consider to be a better solution for the migration and that is to do the required transitions in the preprocessing routing.

I have no problem if anyone wants to rewrite the ruby-bbcode-to-md gem; maybe that plugin will be useful in the future for those who might want to post legacy bbcode; but for me, I prefer we migration to markdown 100% and avoid all legacy bbcode.

That's all for now.
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.

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

These 2 Users Gave Thanks to Neo For This Post:
 

4 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Testing BBCODE URL for DragonByte

Here is the URL we will use: https://www.unix.com/post-here-contact-site-administrators-moderators/241569-doesnt-allow-me-use-code-tags.html I will put this in this text with the URL BBCODE. Now I will save the thread and test the URL. (1 Reply)
Discussion started by: Neo
1 Replies

2. What is on Your Mind?

Changes to BBCODE for CODE and QUOTE

Hey, Scrollbars still do not work in code tags (works on mobile because the mobile site does not use any table tags, only div tags), but hopefully that will change when I convert the bits for post and threads to div tags or update to Bootstrap CSS for tables. In the meantime, I have update... (0 Replies)
Discussion started by: Neo
0 Replies

3. What is on Your Mind?

Patreon Badges Now Available as BBCODE at UNIX.COM

Dear All, We have a lot of amazing moderators and other very talented unix.com members who provide tireless top quality free technical support assistance to others. As a service to those long term unix.com members, I am making a new Patreon BBCODE badge available which can be posted in forum... (8 Replies)
Discussion started by: Neo
8 Replies

4. OS X (Apple)

Back on python for the AMIGA again and discovered this little gem...

I am back on Python for the AMIGA again and discovered this little gem that exits the program:- (If you search GOOGLE as 'os.sys.exit()' python nothing seems to appear.) import os os.sys.exit()I know of the other four and how they apply but I have no idea whether this creates any zombies or... (2 Replies)
Discussion started by: wisecracker
2 Replies
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy