Skip to content
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

Update content filtering options for TinyMCE #4060

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

petschki
Copy link
Member

@petschki petschki commented Nov 13, 2024

fixes #3204

This reduces the loaded page size for forms with tinymce
(tested with curl --user admin:admin -so /dev/null http://localhost:8080/Plone/edit -w "%{size_download}")

Before: 128.620 Bytes
After: 75.674 Bytes

@mister-roboto
Copy link

@petschki thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@petschki
Copy link
Member Author

@jenkins-plone-org please run jobs

@petschki petschki requested a review from thet November 13, 2024 11:10
@petschki
Copy link
Member Author

petschki commented Nov 13, 2024

To demonstrate the impact: collective.easyform has 4 TinyMCE editors in the schema:

Before: 343.143 Bytes
After: 143.341 Bytes

😳

@petschki petschki requested a review from yurj November 13, 2024 11:15
for tag in nasty_tags:
tag_str = "{}[{}]".format(tag, "|".join(valid_attributes))
tiny_valid_elements.append(tag_str)
tiny_config["valid_elements"] = ",".join(tiny_valid_elements)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we don't need this anymore?
We need to make sure, that what ever is set in the HTML filter control panal is not in conflict with what TinyMCE filtering does. Is that's the case I'm fine with the simplification.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Only relying on the "html5" schema doesn't fit our safe_html transformation. I've updated this to fix our test scenarios again.

@petschki
Copy link
Member Author

@jenkins-plone-org please run jobs

1 similar comment
@petschki
Copy link
Member Author

@jenkins-plone-org please run jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default valid_elements field in pattern options adds 40kb for every RichtTextField on an edit page
3 participants