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
[#33796] TinyMCE clean up on paste #3661
Changes from 1 commit
6cac002
3ebb10a
121a453
d97c771
9c93fa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,6 +387,23 @@ public function onInit() | |
$toolbar4_add[] = 'paste'; | ||
} | ||
|
||
// Clean up on paste | ||
$clean_up = $this->params->get('paste_clean_up', 0); | ||
|
||
if ($clean_up) | ||
{ | ||
if (!$paste) | ||
{ | ||
$plugins[] = 'paste'; | ||
} | ||
$clean_up_plugin = 'paste'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please review coding styles vs Joomla! Coding Standards . A space is required after an if statement. Also for var names use camelCase. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You mean empty line?
I will fix that, but all other variables in this file is in '$clean_up' style |
||
$clean_up_param = 'paste_auto_cleanup_on_paste: true,'; | ||
} | ||
else | ||
{ | ||
$clean_up_param = ''; | ||
} | ||
|
||
$toolbar4_add[] = '|'; | ||
|
||
// Visualchars | ||
|
@@ -627,9 +644,10 @@ public function onInit() | |
extended_valid_elements : \"$elements\", | ||
$forcenewline | ||
$smallButtons | ||
$clean_up_param | ||
invalid_elements : \"$invalid_elements\", | ||
// Plugins | ||
plugins : \"table link image code charmap autolink lists importcss\", | ||
plugins : \"table link image code charmap autolink lists importcss $clean_up_plugin\", | ||
// Toolbar | ||
toolbar1: \"$toolbar1\", | ||
toolbar2: \"$toolbar2\", | ||
|
@@ -671,6 +689,7 @@ public function onInit() | |
extended_valid_elements : \"$elements\", | ||
$forcenewline | ||
$smallButtons | ||
$clean_up_param | ||
invalid_elements : \"$invalid_elements\", | ||
// Plugins | ||
plugins : \"$plugins\", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean this? This to me reads the text is removed and the tags are kept. I don't think that's what you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, text not removed. In fact it not jsut remove the styles, it replace some styles with tags and remove unnecessary tags. I'm trying to find the correct description of this function...
In the TinyMCE documentation about this function says simply "clean up", without details.
This description would suit?
"If enabled contents will be automatically cleaned up when you paste using Ctrl+V or similar methods."