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.

#117846 Format HTML option is not remembered in Code View

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 ugd on Tuesday, 07 July 2026 14:29 BST

ugd

Hi at JCE support,

I'm using the Code View in JCE Editor, and I've noticed a small inconsistency.

The following options are remembered correctly between articles and after saving:

• Code highlighting
• Line numbers
• Word wrap

However, "Format HTML" (automatic indentation/formatting) is always turned off again after saving the article or leaving it. I have to enable it every time I edit HTML.

Is there a setting somewhere that makes "Format HTML" stay enabled permanently, either globally or per user?

If not, would it be possible to make it behave like the other Code View options that remember their state?

All the Best,

Ulric

Ryan

Format HTML is an "action" button, which executes when clicked. If the option is enabled in the Code Editor parameters, then the HTML is formatted when opening the Code Editor.

Ryan Demmer

Lead Developer / CEO / CTO

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

ugd

Hello Ryan,

Thank you, I found the **Format HTML** option. It was exactly what I was looking for, and it works perfectly. Thanks!

I have one more question about the Styles dropdown in JCE.

I have added my own custom CSS file (`kk-grid.css`) to the Editor so the classes can be selected directly from the Styles dropdown.

JCE reads the CSS file correctly, and many of the classes appear as expected.

However, classes that contain numeric suffixes or number combinations do not appear. For example:

* .kk-md-2 
* .kk-lg-4-8 

These are valid CSS class names, as they do not start with a number.

Is there a reason why JCE does not include these classes in the Styles dropdown? Could this be related to the way the CSS parser handles class names containing numbers?

Best regards,

Ulric

Ryan

I've tested both your class names, and both appear in the Styles list.

Do other classes in the kk-grid.css file appear?

However, classes that contain numeric suffixes or number combinations do not appear. For example:

* .kk-md-2
* .kk-lg-4-8

What do these look like in full?

Ryan Demmer

Lead Developer / CEO / CTO

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

ugd

Yes, other classes from kk-grid.css do appear in the Styles list.

I have now tested this a bit further and found the difference.

If I add the class at the root level of the CSS file, for example:

.kk-md-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

then it appears in the Styles dropdown.

However, if the same class is only defined inside a media query, it does not appear:

@media (min-width: 768px) {
  .kk-md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

So it looks like the Styles dropdown does not pick up classes that are defined only inside media queries.

Is this expected behavior?

Best regards,

Ulric

Ryan

It's "expected behaviour" because the parsing of the css does not handle nested classes like inside media queries. You can fix this by adding an empty rule just above the media query, eg:

kk-md-2 {}
@media (min-width: 768px) {
  .kk-md-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

Ryan Demmer

Lead Developer / CEO / CTO

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

ugd

Hello Ryan,

That explains it perfectly.

Thank you for the clarification and the suggested workaround. I tested it, and adding an empty rule before the media query works exactly as expected.

I appreciate your quick help!

Best regards,

Ulric

Case closed 😀