stephenharris / WP-MarkDown

WP-MarkDown plug-in. Allows Markdown to be enabled in posts, comments and bbPress forums.
http://wordpress.org/extend/plugins/wp-markdown/
112 stars 19 forks source link

Add button to WP-MarkDown toolbar? #55

Closed mAAdhaTTah closed 10 years ago

mAAdhaTTah commented 10 years ago

I'm a heavy user and big fan of WP-MarkDown, and I'm working on implementing a button to the normal TinyMCE editor, which I'm sure will be useful enough for most people but I'd like to also add this button to the WP-MD toolbar. Is this currently possible? If so, can you point me at how? Thanks!

stephenharris commented 10 years ago

Unfortunately as far as I'm aware this won't be possible. Maybe it is, but I'll explain why TinyMCE is disabled when using WP-MD for a post type. TinyMCE/WordPress (when switching from Visual to Text) 'corrects' the HTML. Since it's not expecting markdown, the entered markdown gets clobbered.

It might be possible to jump in, convert the markdown to HTML and feed that to TinyMCE (But then you need to work out how to do the reverse - it's not easy!).

Sorry I can't be of any more help, but if you go ahead with this, good luck and I'd love to see what you come up with!

mAAdhaTTah commented 10 years ago

I'm sorry, my question was incomplete. All the button does is insert a shortcode after selecting a post from a custom post type. I'm working on registering that button in TinyMCE, but I'm wondering how I would register this button on your editor.

Edit: I'm working on a plugin! Derp, most important part :-/

Does that make more sense?

mAAdhaTTah commented 10 years ago

My mistake, I thought you actually swapped out the TinyMCE editor for your own, instead of just disabling the visual editor. Nevermind!