3

I have a problem with TinyMCE:

I need to get this code:

<blockquote>
    <h2>REVOLUTIONARY QUOTE RELATING MANIFESTO TO PROJECT GOES HERE</h2>
    <hr/>
    <p>Erik Heinsholt</p>
</blockquote>

TinyMCE settings:

valid_elements: "a[href|target|title],ul,ol,li,br,strong/b,em/i,span[style<text-decoration: underline;|class],u,p,blockquote,hr,h2",
force_br_newlines: false,
force_p_newlines: true,
theme_advanced_buttons1: "undo,redo,|,bold,italic,underline,|,hr,code,preview, styleselect",
schema: "html5",
style_formats : [
    {title : "First Word", inline : "span", classes : "first_word"},
    {title : "Blockquote", block : "blockquote"},
    {title : "Quote Header", inline : "h2"}
]

What I have: I write in admin textarea "REVOLUTIONARY QUOTE RELATING MANIFESTO TO PROJECT GOES HERE <hr /> Erik Heisholt", then select "REVOLUTIONARY QUOTE RELATING MANIFESTO TO PROJECT GOES HERE", set a style "Quote Header" for it, then select all and set a style "Blockquote" for it. As a result I get this:

<blockquote><h2>REVOLUTIONARY QUOTE RELATING MANIFESTO TO PROJECT GOES HERE</h2></blockquote>
<blockquote><hr /></blockquote>
<blockquote><p>Erik Heinsholt</p></blockquote>

What should I do to put all elements in one blockquote tag, not each element??

p.s.: the video describing this problem: http://www.sendspace.com/file/nkz97d

4

1 回答 1

0

查看 tinymce 配置参数valid_elementsvalid_children。您可以定义h2- 和hr-tags 可能是其他 htmlnodes 的子节点。

于 2012-11-15T11:33:17.590 回答