You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#99620 Custom CSS tags removed automatically

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Thursday, 02 May 2019 12:37 BST

anildagia
Hello,

I have a Joomla website on Joomla 3.9.5 with rt_plethora template from RocketTheme

Recently I have started facing this issue. My custom CSS tags are automatically removed from the article content.

Steps to reproduce are as follows:

1) New Article
2) Type some text - for example - My Test Header
3) Toggle Editor to switch to HTML code view
4) add custom CSS tag - <myh1>My Test Header</myh1>
5) Toggle Editor to switch to Text Editor view
6) Toggle Editor back to HTML code view & BINGO - the custom CSS tags have disappeared

P.S.: If I save the article while still in HTML code editor view - then the custom CSS tags are retained.

More steps to reproduce
1) Open Existing article which has custom CSS tags
2) Toggle Editor to switch to HTML code view
3) Bingo - the custom CSS tags have disappeared
4) Close article without saving
5) Open article (Article now opens directly in HTML code view)
6) And BINGO - the custom HTML tags are present.

P.S.: If I save the article while still in HTML code editor view - then the custom CSS tags are retained.


Note that I have already done the following:
A) Joomla Global Configuration - Text Filters - Set to No Filters for Super User and Administrator

B) JCE Global Configuration
- Editor Styles set to "Custom CSS"
- Custom CSS entries include the following
templates/$template/less/template.less
templates/$template/less/template-custom.less

C) JCE Editor Profiles - Default Profile -Editor Paramters - Advanced - Allow JS, CSS & PHP all set to Yes.

Please help. This is very cumbersome to lose the custom CSS tags in Text editor mode.

Best Wishes,

- Anil

Ryan
4) add custom CSS tag - <myh1>My Test Header</myh1>


This is not a Custom CSS tag, this is a custom HTML tag.

By default, editor supports valid HTML4 and HTML5 tags and attributes (with some exceptions for security purposes)

To use a custom HTML tag, you can add it to the Extended Elements List in Editor Profiles -> Editor Parameters -> Advanced, eg:

https://cdn.joomlacontenteditor.net/tmp/99620-custom-css-tags-removed-automatically.jpg

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

anildagia
OK.

Now I have another symptom

Say I put the text is <p><myh1>Paragraph 1 text</myh1></p>

And I save it.

What happens s that the paragraph tags disappear. All that remains is - <myh1>Paragraph 1 text</myh1> If the nesxt paragraph also has one of these custom tags - then both paragraphs merge and become one.

How do I prevent that? Should I also add the paragraph tag in the extended element? Even if I do that, still the same symptom occurs. So adding p tag to extended elements does not have the required impact.

Ryan
In the Editor Global Configuration, set Validate HTML to No.

https://cdn.joomlacontenteditor.net/tmp/99620-custom-css-tags-removed-automatically-2.jpg

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.