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

Summarize, simplify, and ask questions about this content using your preferred AI provider.

Text Tools

Generate cleaner and easier-to-read versions of this content instantly

Have a Question?

Ask anything related to this content and get a focused AI-generated answer.

0/500
Mahmoud Ramadan
Author

Mahmoud Ramadan

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