I use rails and have a markItUp editor using the special Markdown suite. The only thing I can’t understand is forcing it to send the original Markdown instead of the converted html. I plan to store both formats, but I did not find anything capable of parsing html back to markdown. I set up the set.js label set as we don’t need the whole set of formatting options. Here:
myMarkdownSettings = {
previewParserPath: '',
onShiftEnter: {keepDefault:false, openWith:'\n\n'},
markupSet: [
{name:'Bold', key:'B', openWith:'**', closeWith:'**'},
{name:'Italic', key:'I', openWith:'_', closeWith:'_'},
{name:'Bulleted List', openWith:'- ' },
{name:'Link', key:'L', openWith:'[', closeWith:']([![Url:!:http://]!] "[![Title]!]")', placeHolder:'Your text to link here...' }
]
}
And here is the onready code for the page where the markitup elements appear:
$.editable.addInputType('markitup', {
element : $.editable.types.textarea.element,
plugin : function(myMarkdownSettings, original) {
$('textarea', this).markItUp(myMarkdownSettings);
}
});
$('.editable').editable({type : 'markitup'});
This works, but it is an html. I tried to use wmd, because there is an option for output, which supports markdown text as is, but could not get it to fly. Thank.