I have been using CKEditor for some time and it has worked great. I've pretty much gotten rid of any problems that ive had but this one i cant seem to figure out. When i add inline attributes to elements for instance style = "color: #ff0;"
on a <p></p>
tag they are stripped out when i switch from wysiwyg to source view. No saving or submission is done and ckeditor is has been added to my site which is my own script. Any ideas as to what would cause this. All of the search results i can find correspond to this happening in Drupal but Drupal seems to be the problem not the editor in all instances. Thanks again!
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
For anyone looking for a simple sample on how to enabled additional markup in CKEditor without disabling ACF completely, here is a short snippet:
extraAllowedContent here enables the
<style>
element, allows two additional attributes (in square brackets) for all (*
is a wildcard) already allowed elements, allows usage of any class names(*)
for them and allows usage of any inline styles{*}
It feels like you're using CKEditor 4.1+ that comes with Advanced Content Filter (ACF). If so, you need to specify
config.allowedContent
and configure it to get your things working. You may also be interested inconfig.extraAllowedContent
.See this answer for more details.
I faced the same issue and below answer solved my problem:
I had the same problem, that ck was stripping not only some attributes, but whole elements when pasting a block element, inside a block element (div with some attributes pasted inside a p) while using this method:
what solved the problem was using this workaround instead:
hi you can stop ACF easily . by default your configaration is---
just add this in the curly brackets:
now your configuration will be: