Set tinymce plugin to use joomla filters.
On joomla filters from global configuration set to no filter.
After save on editor e.g. custom module it cleans up my code based on html4. No even in html5.
I thought It should have not change my code at all.
e.g.
<a href="blabla.gr"><div>blabla</div><div>test</div></a>
Changes it based on html4 which was not allowed.But in html5 we allowed to do that.
The result after saving is that:
<div>blabla</div>
<div>test</div>
Also it comments out <?php echo 'hey'?>
and turns it into <!--?php echo 'heyy';?-->
but i can write <script>alert('hey');</script>
code normally.
Joomla 4.3
Am i doing something wrong or there is an option from settings to allow all this?
Btw it strips it like it uses htm4.
Thanks a lot <3
Labels |
Added:
No Code Attached Yet
|
<a href="blabla.gr"><div>blabla</div><div>test</div></a>
This is NOT a valid value for the link tag according to the HTML specs: https://html.spec.whatwg.org/multipage/links.html#introduction-2 so tinyMCE rightfully discards the element. You can use <a href="https://blabla.gr"><div>blabla</div><div>test</div></a>
or maybe (I haven't tested it) <a href="//blabla.gr"><div>blabla</div><div>test</div></a>
Also it comments out and turns it into but i can write <script>alert('hey');</script> code normally.
The php tags converted to comments actually is a security enforced by Joomla. Finally consider NOT writing style or script elements inside your articles, instead create a textarea custom field for each type and in the layout pass the value through the Joomla API: eg \Joomla\CMS\Factory::getDocument()->getWebAssetManager()->addInlineScript($scriptContent, $options, $attributes);
...
https://www.tutorialspoint.com/is-wrapping-a-div-inside-an-anchor-tag-valid-code
But why tinymce keep removing and chaning the code when its setted to be handled by joomla?
How we can prevent from doing any changes?
It also changes the linkes from "/" to the domain link e.g. "myexample.com".
when i type "/index.php" it will always turn it to "myexample.com/index.php" by tinymce.
I changes from the tinymce plugin paths from relevant to absolute but behaviour stays the same.
When we make a demo site and we are going to transfer it, we will have to change every path from the begging which is very annyoing.
How we can prevent tinymce from changes like those to happen?
when i type "/index.php" it will always turn it to "myexample.com/index.php" by tinymce.
That's Joomla, not tinyMCE that applies this:
joomla-cms/plugins/system/sef/sef.php
Lines 102 to 113 in a950b53
In sort these links are manipulated at run time so when you will transfer the site the links will point to the right domain. There's nothing wrong on this behaviour, actually it's far better than the hardcoding version of wp, where you have to do a search and replace manually if the domain changes...
It replaces it before saving the custom module or article on backend.When you switch from source code to editor it already changed that.
Because i have already done a transfer i can confirm that it does not changes the path. after transfer dynamically.
Also html5 allows inside divs in a tags and it also pass succesfully throw all w3 checks if its a div inside an a tag.
Title |
|
Tinymce is making these changes. Nothing joomla can do about that. You can verify it by checking on one of tinymce demos.
I figured that out.But is there any way to prevent all those changes from being doing and to be handled by joomla filters completly?
Cause its kinda annoying to go changing all the paths it thinks its right cause joomla can manipulate them fine.This is a trouble on site transfering.
The only solution is to change the editor to another?
I appreciate your time!
https://www.tiny.cloud/docs/configure/url-handling/#interactiveexamplenourlconversion
Here it doesnt convert the urls.Maybe its on the initiallization settings/configuration of the tinymce.
It would be perfect if we got some important controls like that in tinymce plugin settings so tinymce can be initiallized on the needings of everyone.
when i type "/index.php" it will always turn it to "myexample.com/index.php" by tinymce.
changes from the tinymce plugin paths from relevant to absolute but behaviour stays the same.
I can not confirm that. I only get that when the option is set to absolute (not the default behaviour). This option is using the tinymce setting as documented in the link you showed
Labels |
Added:
bug
|
I set the bug label because I don't think it is a feature request. That does not mean, that I consider this a valid bug.
It looks like it already have been fixed.
It was a problem before but after updates it is fixed.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-08-22 09:03:36 |
Closed_By | ⇒ | Hackwar |
<a href="blabla.gr"><div>blabla</div><div>test</div></a>
The changes made to that line are being made by tinymce - not joomla. You can confirm that by testing one of their own demos. Nothing we can do about that