我有一个TinyMCE字段,初始化如下:
... 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%" ...
问题是块引用和对齐不起作用。我可以手动将相应的标记插入到字段的html中,但是使用“缩进”按钮或“对齐”按钮根本不会插入任何标记,尽管它们的预览显示它们正在缩进/对齐。
有人知道为什么会发生这种事吗?
谢谢。
发布于 2010-01-03 12:40:45
您使用的是哪个版本的TinyMCE?您在html视图中使用了哪些标记来实现所需的缩进?
当“缩进”或“对齐”按钮被裁剪时,TinyMCE会添加"CSS Style“。
对于例如:输入到编辑字段中的文本被包装在一个'P‘标记中,如下所示
<p>Some text</p>
如果您单击"Identation“按钮,它将添加一个样式,如
<p style="padding-left: 30px;">Some text</p>
HTH
发布于 2011-12-06 07:14:42
它的设置是:"force_br_newlines: true“,用来防止可缩进/可对齐的标记被换行。
他们建议永远不要使用那个选项,只使用一些继承的CSS来设置所有段落的样式,比如。这在我编辑HTML电子邮件的情况下不起作用,但它可能对你很好。
http://www.tinymce.com/wiki.php/Configuration:force_br_newlines
https://stackoverflow.com/questions/1993958
复制相似问题