mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-19 13:01:19 +00:00
fix: update form_textarea to prevent escaping value
replace form_markdown_textarea with form_textarea
This commit is contained in:
parent
73ad94c1d5
commit
78548b5cd7
@ -2,14 +2,14 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (! function_exists('form_markdown_textarea')) {
|
||||
if (! function_exists('form_textarea')) {
|
||||
/**
|
||||
* Textarea field
|
||||
* Adapted textarea field from CI4 core: without value escaping.
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param mixed $extra
|
||||
*/
|
||||
function form_markdown_textarea($data = '', string $value = '', $extra = ''): string
|
||||
function form_textarea($data = '', string $value = '', $extra = ''): string
|
||||
{
|
||||
$defaults = [
|
||||
'name' => is_array($data) ? '' : $data,
|
||||
@ -38,9 +38,9 @@ if (! function_exists('form_markdown_textarea')) {
|
||||
unset($defaults['cols']);
|
||||
}
|
||||
|
||||
return '<textarea ' . rtrim(parse_form_attributes($data, $defaults)) . stringify_attributes($extra) . '>'
|
||||
. $val
|
||||
. "</textarea>\n";
|
||||
return '<textarea ' . rtrim(parse_form_attributes($data, $defaults)) . stringify_attributes(
|
||||
$extra
|
||||
) . '>' . $val . "</textarea>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class MarkdownEditor extends FormComponent
|
||||
$this->attributes['class'] = 'bg-elevated border-none focus:border-none focus:outline-none focus:ring-0 w-full h-full';
|
||||
$this->attributes['rows'] = 6;
|
||||
|
||||
$textarea = form_markdown_textarea($this->attributes, old($this->name, $this->value));
|
||||
$textarea = form_textarea($this->attributes, old($this->name, $this->value));
|
||||
$markdownIcon = icon(
|
||||
'markdown',
|
||||
'mr-1 text-lg opacity-40'
|
||||
|
Loading…
x
Reference in New Issue
Block a user