Hello.
I tried this against the latest discourse master bff965327c0677768e58dd9eaf2b834a22d2342f
The issue is if you have a phpbb post that contains exactly
https://www.youtube.com/watch?v=COvnHv42T-A
and you are using @neil’s version of bbcode_to_md. You have a raw post_text of
<!-- m --><a class="postlink" href="https://www.youtube.com/watch?v=COvnHv42T-A">https://www.youtube.com/watch?v=COvnHv42T-A</a><!-- m -->
which goes through text_processor.rb process_links which changes it to
[youtube.com/watch?v=COvnHv42T-A](https://www.youtube.com/watch?v=COvnHv42T-A)
which then goes through bbcode_to_md code and turns into
http://www.youtube.com/watch?v=COvnHv42T-A)
It seems that the problem is that the import script text_processor is assuming that process_links is going to happen after the bbcode_to_md is run in base.rb, but it happens before. If I reverse the order of them by moving the bbcode_to_md call into text_processor.rb, it seems to fix it, but I’m not sure if that breaks other import scripts.
Ryan