0

我正在使用 MarkitUp bbcode 编辑器,但我不知道如何使用预览系统。当我在编辑器上写作时,我想显示像 stackoverflow 显示的预览。

这是 MarkitUp 的链接:http: //markitup.jaysalvat.com/documentation/

这是我尝试过的:

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'}
    ]
}

预览设置在底部,但不起作用;-(

4

1 回答 1

1

我认为您需要在 mySettings 变量中设置 previewParserPath 。我相信默认是:previewParserPath: "~/sets/bbcode/preview.php",

于 2013-06-28T20:30:52.967 回答