1

在我的数据库中,我存储了这样的东西:

<p>something</p>

然后我将该值加载到标记编辑器中,但它一直像这样显示

&lt;p&gt;something&lt;/p&gt;

我怎样才能让它显示<p>something</p>在markitupeditor中?

设置:

// used for the markitup editor
     mySettings = {
        nameSpace:      'html',
        onShiftEnter:   {keepDefault:false, replaceWith:'<br />\n'},
        onCtrlEnter:    {keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
        onTab:          {keepDefault:false, replaceWith:'    '},
        markupSet:  [   
            {name:'Heading 2', key:'2', openWith:'<h2(!( class="[![Class]!]")!)>', closeWith:'</h2>', placeHolder:'Your title here...' },
            {name:'Paragraph', openWith:'<p(!( class="[![Class]!]")!)>', closeWith:'</p>'  },
            {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'}
        ]
     }
4

1 回答 1

0

我的 html 标签被转换为特殊字符的原因是因为我在我的 codeigniterform_textarea函数上设置了一个参数。

于 2011-11-16T15:10:13.297 回答