diff --git a/src/Pipes/Input.php b/src/Pipes/Input.php index cf380d9..1eae8b8 100644 --- a/src/Pipes/Input.php +++ b/src/Pipes/Input.php @@ -8,7 +8,10 @@ class Input { public function handle(LaravelTrix $trix, \Closure $next) { - $html = is_object($trix->model) && $trix->model->exists ? htmlspecialchars(optional($trix->model->trixRichText()->where('field', $trix->config['field'])->first())->content, ENT_QUOTES) : old($trix->loweredModelName.'-trixFields.'.$trix->config['field'], ''); + $html = is_object($trix->model) && $trix->model->exists ? optional($trix->model->trixRichText()->where('field', $trix->config['field'])->first())->content : old($trix->loweredModelName.'-trixFields.'.$trix->config['field'], ''); + + //Convert both double and single quotes. + $html = htmlspecialchars($html, ENT_QUOTES); $trix->html .= "";