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

Strange tag filtering setting #137

Open
Ruslan-Aleev opened this issue Apr 16, 2024 · 2 comments
Open

Strange tag filtering setting #137

Ruslan-Aleev opened this issue Apr 16, 2024 · 2 comments

Comments

@Ruslan-Aleev
Copy link

Bug report

Summary

The component has a tinymcerte.valid_elements setting where you can set allowed tags and it is empty by default (which is already confusing).
For example, by default the span tag is cut out of the editor, I go to the settings, add a span, but now other tags are cut out, such as h1, which was not cut out before. Very confusing behavior.

Maybe it’s worth leaving only the setting, where all the working tags will be listed, and they can be changed?
I immediately see the available tags and can remove/add others. And not like now - wondering which tags are cut out by default.

Environment

TinyMCE Rich Text Editor 2.0.9

@atorockio
Copy link

I agree that the behavior is not what we might think at first.

This is the way that the configuration works in the TinyMCE editor, not added by the MODX package, though.

According to the Tiny documentation,

The valid_elements option defines which elements will remain in the edited text when the editor saves.

If valid_elements is set it replaces the default valid elements.

They continue:

If you just want to add or change some behavior for a few items, use the extended_valid_elements option

In the MODX package, you can add span to extended_valid_elements in the tinymcerte.settings system setting like this:

{"extended_valid_elements": "span" }

By the way, you can also use invalid_elements to remove elements from the default set.

It would be nice to have additional MODX system settings for content filtering. 😃

@Ruslan-Aleev
Copy link
Author

@atorockio Thanks for the detailed answer =)
Perhaps it is worth adding additional info to the description of system settings.

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

No branches or pull requests

2 participants