开发者

TinyMCE and blockquotes

开发者 https://www.devze.com 2022-12-15 02:54 出处:网络
I have a TinyMCE field initialized as follows: ... extended_valid_elements: \"ul[type],li,a[name|href|target|title],img[class|src|border|alt|title|hspace|vspace|width|height|align|name|style],hr[clas

I have a TinyMCE field initialized as follows:

        ... extended_valid_elements: "ul[type],li,a[name|href|target|title],img[class|src|border|alt|title|hspace|vspace|width|height|align|name|style],hr[class|width|size|noshade],span[class|align|style],iframe[src|class|width|height|name|align],#p/div,strike",
        force_br_newlines: true,
        mode : "none",
        plugins: "autosave",
        relative_urls : false,
        removeformat_selector: "b,strong,i,em,u,s,strike,del,ins,span,font,sup,sub,pre,tt,code,samp,kbd,var,listing,plaintext,xmp,big,small,abbr,acronym,address,bdo,blockquote,cite,q,defn",
        theme : "advanced",
        theme_advanced_blockformats: "h1,h2,h3,h4,h5,pre,blockquote",
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,fontselect,fontsizeselect,formatselect,forecolor,backcolor,image,link,bullist,numlist,outdent,indent,justifyleft,justifycenter,justifyright,removeformat,fullscreen,code",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_font_sizes: "x-small=1;small=2;normal=3;large=4;x-large=5;xx-large=6",
        theme_advanced_fonts: "Sans Serif=sans-serif;Serif=serif;Fixed Width=monospace",
        theme_advanced_path: false,
        theme_advanced_resize_horizontal : false,
        theme_advanced_resizing : true,
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        width: "100%" ...

The problem is that blockquotes and alignment are not working. I can manually insert the corresponding tags 开发者_如何转开发into the html of the field, but using the "Indent" button or align buttons does not insert any tags at all, although their preview shows that they are being indented / aligned.

Anyone know why this might be happening?

Thanks.


It's the setting: "force_br_newlines: true" that prevents an indentable/alignable <p> tag from being wrapped around your line.

They suggest never using that option and just using some inherited CSS to style all of your paragraphs like <br/>. That doesn't work in my case where I am editing HTML email, but it might work fine for you.

http://www.tinymce.com/wiki.php/Configuration:force_br_newlines


Which version of TinyMCE are you using? Which tags are you using in the html view to achieve the desired indentation?

TinyMCE adds a "CSS Style" when "Indentation" or "Alignment" buttons are cliked

For eg: Text entered into the edit field gets wrapped inside a 'P' tag like

<p>Some text</p>

If you click the "Identation" button it will add a style like

<p style="padding-left: 30px;">Some text</p>   

HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号