how to add a class to the RichEditor

How to add a class to the RichEditor tag <p> example
<p class="one">asdfadf<p>
<p class="one">asdfadf<p>
And if possible, be able to choose which class to apply
3 Replies
Smurfetka
SmurfetkaOP14mo ago
I did this in tinymceI did this in tinymce
tinymce.init({
selector: 'textarea#content',
theme_advanced_buttons1: "styleselect,image",
content_css: "{{ asset("css/style.css") }}",
style_formats: [
{
title: 'My Foo styles'
}, {
title: 'big_text',
block: 'p',
classes: 'text-base md:text-2xl font-normal text-gray-500 mb-5',
exact: true
},
{
title: 'normal_text',
block: 'p',
classes: 'text-base md:text-lg font-normal text-gray-500 mb-5',
exact: true
},
{
title: 'h2',
block: 'h2',
classes: 'leading-tight text-2xl md:text-4xl font-bold mb-4 md:mb-5 dark:text-white',
exact: true
}
],
plugins: 'image',
toolbar: ' undo redo | bold italic underline strikethrough | styles |alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | removeformat',
// toolbar: 'styleselect | image | aria-haspopup | fontselect ',
images_upload_url: '{{ route('ajax.post.add_img') }}', // Указываете URL для обработки загрузки изображений на сервере
automatic_uploads: true, // Автоматически загружать изображения после выбора
tinymce.init({
selector: 'textarea#content',
theme_advanced_buttons1: "styleselect,image",
content_css: "{{ asset("css/style.css") }}",
style_formats: [
{
title: 'My Foo styles'
}, {
title: 'big_text',
block: 'p',
classes: 'text-base md:text-2xl font-normal text-gray-500 mb-5',
exact: true
},
{
title: 'normal_text',
block: 'p',
classes: 'text-base md:text-lg font-normal text-gray-500 mb-5',
exact: true
},
{
title: 'h2',
block: 'h2',
classes: 'leading-tight text-2xl md:text-4xl font-bold mb-4 md:mb-5 dark:text-white',
exact: true
}
],
plugins: 'image',
toolbar: ' undo redo | bold italic underline strikethrough | styles |alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | removeformat',
// toolbar: 'styleselect | image | aria-haspopup | fontselect ',
images_upload_url: '{{ route('ajax.post.add_img') }}', // Указываете URL для обработки загрузки изображений на сервере
automatic_uploads: true, // Автоматически загружать изображения после выбора
And here I can’t even find where to do all this
No description
awcodes
awcodes14mo ago
The underlying editor for RichEditor doesn’t allow it. You’d be better off using one of the other editor plugins if you require that functionality. There’s even some for tinymce if that’s what you’re used to.
Smurfetka
SmurfetkaOP14mo ago
Thanks
Want results from more Discord servers?
Add your server