小编Hdd*_*THA的帖子

如何使用CKeditor允许所有html标签和属性?

我正在尝试允许所有的html标签

<div> <p> <span> <i> /* etc */
Run Code Online (Sandbox Code Playgroud)

和html属性如下(class,id),例如:

<div id="foo" class="bar" style="z-index:1;">SOME COOL CONTENT HERE</div>
Run Code Online (Sandbox Code Playgroud)

在ckeditor.

我在docs.ckeditor.com找到了类似的东西

config.allowedContent = {
    $1: {
        // Use the ability to specify elements as an object.
        elements: CKEDITOR.dtd,
        attributes: true,
        styles: true,
        classes: true
    }
};
config.disallowedContent = 'script; *[on*]';
Run Code Online (Sandbox Code Playgroud)

并将其添加到config.jsckeditor的根文件夹中.但没有改变.当我试图在ckeditor的源代码块上添加一些html标签时,它正在删除所有的html内容.

我错过了什么?提前致谢.

版本:## CKEditor 4.4.7


编辑和更新:

在@Eelke和@Necreaux回答之后,我allowedContent = true在config.js中添加了.现在基本的html元素如此<div> <span> <h3>完美.但是ckeditor仍然会<i>标记标签.

完全配置JS

    CKEDITOR.editorConfig = function( config ) { 
    config.allowedContent = true;
    config.removeFormatAttributes = '';
    // …
Run Code Online (Sandbox Code Playgroud)

javascript regex ckeditor

19
推荐指数
4
解决办法
4万
查看次数

Cordova - 命令|的错误代码1 命令失败了

我是cordova的新手,所以如果我的问题不相关,请原谅我.我在Windows 7 x64机器上有一个cordova项目.昨天我通过构建我的cordova应用程序cordova build android --release.但我需要添加新的插件cordova-plugin-zip来更新我的cordova项目.我做了什么把这个插件添加到我的cordova应用程序;

  • 我在我的win7 x64环境中安装了一个git应用程序.
  • npm install -g git 我在cmd上写了这个命令.
  • 我打开了Windows环境变量/路径窗口并添加了 ;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
  • 通过此命令添加插件 cordova plugin add https://github.com/apache/cordova-plugin-file.git
  • 然后添加其他插件cordova plugin add https://github.com/MobileChromeApps/zip.git (一切都很好,直到这一步)
  • 然后我在cmd上运行 cordova build android --release

不幸的是,它会抛出以下错误;

BUILD FAILED C:\ android\sdk\tools\ant\build.xml:720:执行此行时发生以下错误:C:\ android\sdk\tools\ant\build.xml:734:编译失败; 有关详细信息,请参阅编译器错误输出.

总时间:7秒

C:\ hascevher\platforms\android\cordova \node_modules\q\q.js:126 throw e; ^命令的错误代码1:cmd with args:/ s,/ c,ant,release,-f,C:\ hascevher\platf orms\android\build.xml,-Dout.dir = ant-build,-Dgen. absolute.dir = ant-gen ERROR构建其中一个平台:错误:cmd:命令失败,退出代码为1

您可能没有所需的环境或操作系统来构建此项目错误:cmd:命令失败,退出代码1在ChildProcess.whenDone(C:\ Users\Hddn\AppData\Roaming \npm \node_modules\cor dova \node_modules\cordova- lib\src\cordova\superspawn.js:134:23)在Process.ChildProcess._handle.onexit(child_process.js)的maybeClose(child_process.js:1015:16)的ChildProcess.emit(events.js:110:17) :1087:5)

当我尝试创建一个新的helloworld cordova项目并添加android平台然后从cmd cordova build android它创建示例应用程序?

那么我的其他应用程序有什么问题? …

git android node.js cordova

18
推荐指数
4
解决办法
10万
查看次数

标签 统计

android ×1

ckeditor ×1

cordova ×1

git ×1

javascript ×1

node.js ×1

regex ×1