tastyigniter / TastyIgniter

:fire: Powerful, yet easy to use, open-source online ordering, table reservation and management system for restaurants
https://tastyigniter.com
MIT License
3.03k stars 988 forks source link

[Bug]: <\textarea> in codeeditor breaks out of the editors textarea #880

Closed CupNoodles closed 3 years ago

CupNoodles commented 3 years ago

What happened?

Go to an editable child theme through the admin UI and select 'Edit template files' and then select any editable file. I'm using a copy of orange theme and the template [account/reset].

At the beginning of the 'Markup' section, add the lines

<textarea></textarea>
This text should remain visible

and then hit 'Save'. The full text is clearly saved to the field, but subsequently loading the editing page shows the 'This text should remain visible' text underneath the codeeditor element. Hitting save again fails to save the full text since only <textarea> is submitted this time.

Screenshot from 2021-10-21 18-20-19

What did you expect to happen?

A <textarea> should be a valid form element to include within the code editor.

Version

3.0.4 (Stable)

What browser are you seeing the problem on?

Firefox

Relevant log output

No response

ryanmitchell commented 3 years ago

Can you try replacing https://github.com/tastyigniter/TastyIgniter/blob/88b6dbe9015d2a31aa3f6910df95040f0e4aa307/app/admin/formwidgets/codeeditor/codeeditor.blade.php#L18 as {{ trim($value) }} instead of {!! ?

CupNoodles commented 3 years ago

Just tested locally, works like a charm!

sampoyigi commented 3 years ago

Sweet! Are you able to submit it as a PR?

CupNoodles commented 3 years ago

Sure thing, added at https://github.com/tastyigniter/TastyIgniter/pull/881