ckeditor

Sanitize user submitted HTML but keep safe embedded iframes

别说谁变了你拦得住时间么 提交于 2020-01-07 05:53:11
问题 I need to sanitize user inputs of malicious html & submitted by CKEditor . I currently use owasp-java-html-sanitizer . for this purpose but it removes embedded iframes as well. But I have genuine use cases like embedding a YouTube video or slide share presentation within posts. How could I allow such embedded iframes safely? I use Java. 回答1: You will need to allow the iframe element and source attribute to your Html policy. You can do it like the following example modified from the java doc /

CKEditor custom styles from file not showing

前提是你 提交于 2020-01-07 04:30:35
问题 I can't seem to add my own CSS file to the CKEditor. I'm downloading a custom version 4.5.8 and include the "StyleSheet Parser" plugin. The "Styles" list has the default styles, but not the ones from my css file. This the code: CKEDITOR.config.contentsCss = '../../../css/test.css'; CKEDITOR.replace('editor1'); The editor is loaded successfully, but the "Styles" list does not contain my styles. The location of my css files seems right, when I try other paths I get an error. This is my test.css

django-ckeditor使用

﹥>﹥吖頭↗ 提交于 2020-01-06 23:02:34
django-ckeditor 1 安装 pip install ckeditor 2 配置 INSTALLED_APPS中添加 'ckeditor', 修改写入字段的格式 主题相关配置(settings) CKEDITOR_CONFIGS = { 'default': { 'toolbar': 'full', 'height': 300, 'width': 600, 'tabSpaces': 4, 'extraPlugins': 'codesnippet', # 配置代码插件 } } 静态文件相关配置(图片) 1 INSTALLED_APPS 中添加 'ckeditor_uploader', 2 文件相关 MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') CKEDITOR_UPLOAD_PATH = 'Article_media' URLconfig 引入包 from django.conf.urls import url,include from django.views.static import serve urlpatterns urlpatterns = [ ... url(r'^ckeditor/', include('ckeditor_uploader.urls'),), url(r

CKEditor not showing when AngularJS swap its view

旧巷老猫 提交于 2020-01-06 18:08:12
问题 My AngularJS Directive is: .directive('ckEditor', function() { return { require: '?ngModel', link: function(scope, elm, attr, ngModel) { var ck = CKEDITOR.replace(elm[0]); if (!ngModel) return; ck.on('pasteState', function() { scope.$apply(function() { ngModel.$setViewValue(ck.getData()); }); }); ngModel.$render = function(value) { ck.setData(ngModel.$viewValue); }; } }; Let's say My View is like following: <textarea ck-editor name="menu_content" style="width:600px; height:300px;" id="menu

CKEditor not showing when AngularJS swap its view

拜拜、爱过 提交于 2020-01-06 18:05:58
问题 My AngularJS Directive is: .directive('ckEditor', function() { return { require: '?ngModel', link: function(scope, elm, attr, ngModel) { var ck = CKEDITOR.replace(elm[0]); if (!ngModel) return; ck.on('pasteState', function() { scope.$apply(function() { ngModel.$setViewValue(ck.getData()); }); }); ngModel.$render = function(value) { ck.setData(ngModel.$viewValue); }; } }; Let's say My View is like following: <textarea ck-editor name="menu_content" style="width:600px; height:300px;" id="menu

Dedicated RTE config per CType

此生再无相见时 提交于 2020-01-06 12:29:14
问题 I want to give the user the minimal RTE for some kinds of custom content elements in TYPO3 8.7. I found this old approach here but it is not compatible with the ckeditor of TYPO3 8. RTE.config.tt_content.bodytext.types.ccc_teasertext { showButtons = bold, italic, underline, link, chMode, orderedlist, unorderedlist RTEHeightOverride = 600 } RTE.config.tt_content.bodytext.types.ccc_introtext { showButtons = bold, italic, chMode RTEHeightOverride = 300 } How do I use RTE.config with the new

.appendchild executing twice in CKeditor

橙三吉。 提交于 2020-01-06 11:47:48
问题 I'm using the simpleuploads plugin for CKeditor. Everything's working perfect except for one itsy bitsy problem. I'm trying wrap an uploaded image object in a div like so <div class="image-container> <img class="addedImg> </div> and have added the following at the bottom of /app/assets/javascripts/ckeditor/config.js CKEDITOR.on('instanceReady', function(e) { e.editor.on( 'simpleuploads.finishedUpload' , function(ev) { var element = ev.data.element; if (element.getName() == 'img') { var img =

Rails 3.1 ckeditor: Adding fontsize in toolbar?

筅森魡賤 提交于 2020-01-06 09:32:47
问题 I have ckeditor in my rails 3.1 app but I am not able to add fontsize and font dropdowns to my toolbar. My edit view code: <%= javascript_include_tag "ckeditor/ckeditor.js" %> ... <%= form_for @page, :html => { :class => 'edit_page', :id => "page_form" } do |page| %> ... <%= page.cktext_area :content, {:height => "350px", :width => "920px"}%> ... <% end %> I am able to adjust the height and width but not add any other parameters? 回答1: Could be late but in rails 3.1 app you can go to /vendor

Rails 3.1 ckeditor: Adding fontsize in toolbar?

廉价感情. 提交于 2020-01-06 09:31:14
问题 I have ckeditor in my rails 3.1 app but I am not able to add fontsize and font dropdowns to my toolbar. My edit view code: <%= javascript_include_tag "ckeditor/ckeditor.js" %> ... <%= form_for @page, :html => { :class => 'edit_page', :id => "page_form" } do |page| %> ... <%= page.cktext_area :content, {:height => "350px", :width => "920px"}%> ... <% end %> I am able to adjust the height and width but not add any other parameters? 回答1: Could be late but in rails 3.1 app you can go to /vendor

Ckeditor and using $_POST to insert into Mysql

一笑奈何 提交于 2020-01-06 08:56:47
问题 Alright, so I have been banging my head for hours on this. Time to turn to the pros. I am using jquery to post the serialized form. I have ckeditor on a page, according to their instruction all I have to do is set the post to a variable and it will work. Well it doesn't. $_POST['TEXTAREA_NAME'] is empty. alright, no problem. I can just use jquery to append the data to the textarea before the post takes place. now all i get is \r\n. help please, what is the best way to get the data from