如何获得tinymce(在浏览器中的“富编辑器”)以保留缩进 [英] how to get tinymce (in-browser "rich editor") to preserve indentation

查看:801
本文介绍了如何获得tinymce(在浏览器中的“富编辑器”)以保留缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:我使用Drupal和富编辑器,富编辑喜欢通过剥离缩进和格式来破坏我的文本。这在桌面编辑器中是不可接受的,但是人们似乎在浏览器中的wyswigs容忍这种情况。

PROBLEM: I use Drupal with a rich-editor, and the rich editor likes to clobber my text by stripping out the indentation and formatting. This would be unacceptable in a desktop editor, but people seem to tolerate this with in-browser wyswigs.

问题:如何关闭这个。我已搜索周围,我还没有发现告诉丰富的编辑器来保存我的缩进和文本格式的最佳实践方法。

QUESTION: How do I turn this off. I've searched around and I have yet to discover the best practice way of telling the rich-editor to preserve my indentation and text formatting.

推荐答案

将此配置添加到tinymce init脚本

add this configuration to the tinymce init script

tinymce.init({
    protect: [/[\n\f\r\t\v]/g]
});

这篇关于如何获得tinymce(在浏览器中的“富编辑器”)以保留缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆