KEEP THE LANGUAGE CLASS ATTRIBUTE UNCHANGED

Mar 22, 2024

I encountered trouble when I needed to highlight a code within an Article using PrismJS, especially in the process of updating because once the article is published, the language class is automatically removed, to overcome this problem you might re-write the language class again and again but, it's not a practical solution because you may forget to do so. Therefore, you can change the editor configuration to always remember the language class: 💆‍♂️

 

let editor = CKEDITOR.replace('your-textarea-id');

editor.config.allowedContent = true;

AI Assistant

Choose AI provider

Text Tools

Make content clear and easy to read

Ask a Question

Get clear answers based on this content

0/500
Mahmoud Ramadan

Mahmoud Ramadan

Mahmoud is the creator of Digging Code and a contributor to Laravel since 2020.