Fix escaping issue for Markdown editor
This commit is contained in:
parent
46cefbc2ba
commit
c8df8a7c8c
|
|
@ -213,7 +213,6 @@ class FormHelper extends Base
|
||||||
{
|
{
|
||||||
$params = array(
|
$params = array(
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'text' => isset($values[$name]) ? $values[$name] : '',
|
|
||||||
'css' => $this->errorClass($errors, $name),
|
'css' => $this->errorClass($errors, $name),
|
||||||
'required' => isset($attributes['required']) && $attributes['required'],
|
'required' => isset($attributes['required']) && $attributes['required'],
|
||||||
'tabindex' => isset($attributes['tabindex']) ? $attributes['tabindex'] : '-1',
|
'tabindex' => isset($attributes['tabindex']) ? $attributes['tabindex'] : '-1',
|
||||||
|
|
@ -232,7 +231,9 @@ class FormHelper extends Base
|
||||||
$params['suggestOptions']['triggers']['@'] = $this->helper->url->to('UserAjaxController', 'mention', array('project_id' => $values['project_id'], 'search' => 'SEARCH_TERM'));
|
$params['suggestOptions']['triggers']['@'] = $this->helper->url->to('UserAjaxController', 'mention', array('project_id' => $values['project_id'], 'search' => 'SEARCH_TERM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = '<div class="js-text-editor" data-params=\''.json_encode($params, JSON_HEX_APOS).'\'></div>';
|
$html = '<div class="js-text-editor" data-params=\''.json_encode($params, JSON_HEX_APOS).'\'>';
|
||||||
|
$html .= '<script type="text/template">'.(isset($values[$name]) ? $values[$name] : '').'</script>';
|
||||||
|
$html .= '</div>';
|
||||||
$html .= $this->errorList($errors, $name);
|
$html .= $this->errorList($errors, $name);
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -62,7 +62,8 @@ KB.component('text-editor', function (containerElement, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Order is important for IE11 (especially for the placeholder)
|
// Order is important for IE11 (especially for the placeholder)
|
||||||
textareaElement.text(options.text);
|
var textWrapper = KB.dom(containerElement).find('script');
|
||||||
|
textareaElement.text(textWrapper.innerText);
|
||||||
|
|
||||||
if (options.placeholder) {
|
if (options.placeholder) {
|
||||||
textareaElement.attr('placeholder', options.placeholder);
|
textareaElement.attr('placeholder', options.placeholder);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue