首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >TinyMCE和块引用

TinyMCE和块引用
EN

Stack Overflow用户
提问于 2010-01-03 12:09:57
回答 2查看 2.6K关注 0票数 0

我有一个TinyMCE字段,初始化如下:

代码语言:javascript
运行
复制
        ... 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中,但是使用“缩进”按钮或“对齐”按钮根本不会插入任何标记,尽管它们的预览显示它们正在缩进/对齐。

有人知道为什么会发生这种事吗?

谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-01-03 12:40:45

您使用的是哪个版本的TinyMCE?您在html视图中使用了哪些标记来实现所需的缩进?

当“缩进”或“对齐”按钮被裁剪时,TinyMCE会添加"CSS Style“。

对于例如:输入到编辑字段中的文本被包装在一个'P‘标记中,如下所示

代码语言:javascript
运行
复制
<p>Some text</p>

如果您单击"Identation“按钮,它将添加一个样式,如

代码语言:javascript
运行
复制
<p style="padding-left: 30px;">Some text</p>   

HTH

票数 0
EN

Stack Overflow用户

发布于 2011-12-06 07:14:42

它的设置是:"force_br_newlines: true“,用来防止可缩进/可对齐的标记被换行。

他们建议永远不要使用那个选项,只使用一些继承的CSS来设置所有段落的样式,比如。这在我编辑HTML电子邮件的情况下不起作用,但它可能对你很好。

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1993958

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档