user007
user007

Reputation: 3243

markItUp bbcode editor, preview not rendering

I am using MarkitUp bbcode editor, but I can't figure out how to use preview system. I want to show a preview like stackoverflow shows when I am writing on a editor.

here is the link to MarkitUp : http://markitup.jaysalvat.com/documentation/

Here what I have tried :

var mySettings = {
    onShiftEnter:   {keepDefault:false, replaceWith:'<br />\n'},
    onCtrlEnter:    {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
    onTab:          {keepDefault:false, replaceWith:'    '},
    markupSet:  [   
        {name:'Bold', key:'B', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
        {name:'Italic', key:'I', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)'  },
        {name:'Stroke through', key:'S', openWith:'<del>', closeWith:'</del>' },
        {separator:'---------------' },
        {name:'Bulleted List', openWith:'    <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ul>\n', closeBlockWith:'\n</ul>'},
        {name:'Numeric List', openWith:'    <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ol>\n', closeBlockWith:'\n</ol>'},
        {separator:'---------------' },
        {name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
        {name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
        {separator:'---------------' },
        {name:'Clean', className:'clean', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },       
        {name:'Preview', className:'preview',  call:'preview', previewPosition: 'after'}
    ]
}

Preview setting is at the bottom, but wont work ;-(

Upvotes: 0

Views: 626

Answers (1)

Carl Schroeder
Carl Schroeder

Reputation: 130

I think you need to set previewParserPath in your mySettings variable. I believe the default is: previewParserPath: "~/sets/bbcode/preview.php",

Upvotes: 1

Related Questions