Page 1 of 1

[Script] Markdown to BBCode Converter

Posted: 08 Jun 2018, 15:41
by geek
Markdown to BBCode Converter

Write your forum posts in Markdown and convert them to BBCode for display on the forum.

Very useful for publishing scripts stored on GitHub!

Image


Usage

Simply paste in your markdown code, hit the convert button, and copy out the BBCode for your forum post.

This converter offers a few special additions to Markdown to make it easier to create consistent posts.

Alternate sections:

Code: Select all

<!-- alternate
Any text in here will be put literally into the BBCode.
This is useful for adding features to your bbcode that are
not available in Markdown.
-->
Any text in here will be omitted from your BBCode. 
This is useful for adding features to your Markdown that
are not available in BBCode.
<!-- /alternate -->
Spoilers:

Code: Select all

<!-- spoiler -->
Text in here will always be visible in Markdown, but
will be wrapped in spoiler tags in the BBCode.
<!-- /spoiler -->



Releases

The latest version can always be found on the GitHub Gist page below.

https://gist.github.com/G33kDude/349c4b ... b2a9677857

Re: [Script] Markdown to BBCode Converter

Posted: 08 Jun 2018, 18:53
by derz00
Nice! Hurray for Regex

Re: [Script] Markdown to BBCode Converter

Posted: 09 Jun 2018, 02:38
by Helgef
Hello

This is good stuff, thanks for sharing .

Code: Select all

### Hello

This is good *stuff*, thanks for `sharing` .
Cheers :thumbup:.

Re: [Script] Markdown to BBCode Converter

Posted: 06 Sep 2018, 04:15
by lexikos
There are some things I use that the script doesn't seem to support: code blocks which aren't marked except by identation, and lists with indentation and -.

Code: Select all

Code follows:

    MsgBox, This is code.

List follows:
  - Item 1
  - Item 2
  
Seems odd to write * at the start of the line for list items.

It would be more convenient if it wasn't single-use (the form is locked once the conversion is performed).

Re: [Script] Markdown to BBCode Converter

Posted: 02 Oct 2018, 08:21
by joedf
Coolio, now you gotta add a preview button ;)

Re: [Script] Markdown to BBCode Converter

Posted: 04 Oct 2018, 11:58
by geek
lexikos wrote:There are some things I use that the script doesn't seem to support: code blocks which aren't marked except by identation, and lists with indentation and -.

Code: Select all

Code follows:

    MsgBox, This is code.

List follows:
  - Item 1
  - Item 2
Seems odd to write * at the start of the line for list items.
I only wrote in support for the subset of Markdown that I was using in my README files at the time, which would explain these lapses.

Supporting four-space prefixing for code blocks will also be a little tricky, though certainly doable when I have the time and inclination.

It would be a simple regular expression tweak to allow - for lists, but allowing for indentation on the first list item will take a little thought.
Using asterisk for lists is supported by GitHub markdown at least, and it makes sense when you're working with a block font that places the asterisk
along the center line. The BBCode that it converts to uses asterisk to denote list items as well so it seemed prudent to follow suit.

lexikos wrote:It would be more convenient if it wasn't single-use (the form is locked once the conversion is performed).
joedf wrote:Coolio, now you gotta add a preview button ;)
Yeah, the GUI was an afterthought; I was shooting for bare minimal functionality. The form locks after conversion
so that you don't accidentally run the converter a second time after it has already been converted to bbcode.

A better UI will be one of my priorities when I revisit this project in the future.

Thank you both for your feedback!

Re: [Script] Markdown to BBCode Converter

Posted: 20 Oct 2020, 21:12
by pk23
Bug Report:

Markdown code:

Code: Select all

[![](https://1.com/(2))](https://1.com/(2)/3)
Expected Result:

Code: Select all

[url=https://1.com/(2)/3][img]https://1.com/(2)[/img][/url]
Actual Result:

Code: Select all

[[img]https://1.com/(2[/img]/3)

Re: [Script] Markdown to BBCode Converter

Posted: 07 Oct 2021, 18:36
by iseahound
@GeekDude Nice script. It doesn't work with in line code snippets, i.e. ``` the three backticks.