简体   繁体   中英

TinyMCE bug with block elements

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??

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

Have a look at the tinymce configuration parameters valid_elements and valid_children . You can define that h2 - and hr -tags may be childs to other htmlnodes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM