Skip to main content
Markdown support Started by forumsearch0r · · Read 4121 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Markdown support

I'd like to have a built-in BBcode or - even better - a switch to use Markdown for formatting my postings.
-

Re: Markdown support

Reply #1

 emanuele looks @Spuds and his idea O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: Markdown support

Reply #2

If there already is a parser, it should be easy to just use it?
-

 

Re: Markdown support

Reply #3

Code: [Select]
	require_once(EXTDIR . '/markdown/markdown.php');
$message = Markdown($message);

You can use the hook integrate_pre_parsebbc so a function like:
Code: [Select]
function parse_markdown(&$message, &$smileys, &$cache_id, &$parse_tags)
{
require_once(EXTDIR . '/markdown/markdown.php');
$message = Markdown($message);
}
attached to that hook should do the trick.
Bugs creator.
Features destroyer.
Template killer.

Re: Markdown support

Reply #4

Why markdown is better? I find it harder to use.

Re: Markdown support

Reply #5

It's different.
I find it easier to do bold or underline rather than have to use square brackets and letters, for example. Also lists are usually easier.
Links and images... meh, both a bit difficult (I always forget what comes first in markdown).

Then bbcode is much more for formatting, while "Markdown is a writing format", so two different things. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Markdown support

Reply #6

Today we have:

MD to HTML = Markdown in the ext dir
BBC to HTML = our buddy parse_bbc
HTML to BBC = Html2BBC.class in subs
HTML to MD = Html2Md.class in subs

I had intended to write a BBC to MD or was that  MD to BBC? now I can't remember which direction I wanted now LOL ...

Today to do those swaps you need to to  BBC to HTML then HTML to MD or MD to HTML and HTML to BBC  and each time you swap the language, indeed something is lost plus its 2x the overhead.

For a simple MD post to work, what emanuele said should work AFAIK, the issue of course is overhead, none of those functions are lite weight, and chaining them could be an issue.   Providing a very lite weight MD to html (or really bbc) for basic bold, itailic, etc md text may be the best option.