-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"text_enabled" plugins in Text plugin become uneditable after saving #405
Comments
Hi, just stumbled across this as well... When inserting a link (as a plugin) and saving the text plugin, the link afterwards is only editable as if it was linked from the editor via the 'Link' control and does not show the link plugin admin. Is this confirmed / does a fix exist? Regards Jakob EDIT: After editing and saving the text plugin again the link plugin originally |
I was able to solve my issue by adding
|
Thanks @jakob-o ! We'll add this to the documentation. @bcdickinson could you please check if that would solve your problem as well? |
I'm not sure where the setting @jakob-o changed is, but that didn't seem to be the problem for me. Having had time to take a look at this myself again, I managed to track the issue down to broken regexes for parsing HTML in The first was a problem in detecting whether the outermost element of the plugins rendered HTML was block-level. It was broken for tags with no whitespace or attributes (e.g. the The second was an error in the wrapping and unwrapping of the I've patched it here: https://github.com/bcdickinson/djangocms-text-ckeditor/commit/beb32a83880af4a693c51ee8d27a1443bf21b848 Is there a test suite I can run? Sorry, new to contributing patches! |
sadly there're currently no automated tests for the frontend part of djangocms-text-ckeditor, only manual testing. it's on my todo list but i don't think i'll be able to do it soon it's still great if you could send us the pull request with this patch :) |
Taken from django-cms/django-cms#5787 by @bcdickinson:
Using a simplified version of the
HelloPlugin
class from the tutorial, but withtext_enabled
set toTrue
:hello_plugin.html:
When it's first added to a text plugin everything works as expected:
... however, once the containg Text plugin is saved and reopened then the content of the plugin ("Hello") is no longer a plugin block, but editable text. Additionally, the
<cms-plugin>
element is now empty in the source view:Saving and reopening the parent text plugin adds a new occurrence of the text every time after this, too:
The text was updated successfully, but these errors were encountered: