vmg / redcarpet

The safe Markdown parser, reloaded.
MIT License
4.99k stars 527 forks source link

markdown to the bb code #445

Closed asiniy closed 9 years ago

asiniy commented 9 years ago

Hello!

Is there any way to convert markdown to bb code with redcarpet? Or, maybe convert markdown to html and then to bb code? I can't find any helpful gem or method. Please help if you can.

robin850 commented 9 years ago

Hello @asiniy,

This is not a feature that ships with Redcarpet by default but you can implement a custom render object to handle this as described in the README file. Just a couple things however:

I'm giving it a close ; thanks ! :-)

asiniy commented 9 years ago

@robin850 may I push the tool to convert the source of redcarpet?

robin850 commented 9 years ago

may I push the tool to convert the source of redcarpet?

Sorry but I'm not sure to understand what you're asking here. Do you mean to add such render to Redcarpet along the ManPage one for instance ?

asiniy commented 9 years ago

@robin850 It seems so

robin850 commented 9 years ago

@asiniy : Well I'm not sure that this will be a good fit unfortunately. BBCode has some features that Markdown doesn't have (e.g. an equivalent to the [color] tag). In case of the built-in render objects like ManPage this is not a problem because Markdown features overpass the features that troff (the markup used to write man pages) provides.

At least since you've spotted this in this issue, people can easily find the bootstrap render object and customize it for their needs. :-)

asiniy commented 9 years ago

@robin850 thanks for hint. You're right! Happy new year!

robin850 commented 9 years ago

Happy new year to you too, thanks! :-)