RichEditor source code button

Hello every one, how in 4 version i can add source code button to RichEditor? Thnx.
3 Replies
toeknee
toeknee4w ago
It is not supported at present, you could make a plugin to add support.
Wrax
Wrax2w ago
I am using a 2 tab setup for this currently:
Tab::make('HTML')
->label('Source View')
->icon(Heroicon::CodeBracketSquare)
->schema([
Textarea::make('description_html')
->label('HTML Source')
->rows(18)
->afterStateUpdated(fn (?string $state, Set $set) => $set('custom_content', $state))
->extraAttributes(['class' => 'font-mono'])
->dehydrated(false),
Tab::make('HTML')
->label('Source View')
->icon(Heroicon::CodeBracketSquare)
->schema([
Textarea::make('description_html')
->label('HTML Source')
->rows(18)
->afterStateUpdated(fn (?string $state, Set $set) => $set('custom_content', $state))
->extraAttributes(['class' => 'font-mono'])
->dehydrated(false),
toeknee
toeknee2w ago
This is a richer plugin repo with the additonal settings not yet made for prod but you can clone the code for your own use case: https://github.com/awcodes/richer-editor
GitHub
GitHub - awcodes/richer-editor
Contribute to awcodes/richer-editor development by creating an account on GitHub.

Did you find this page helpful?