Skip to content

Commit

Permalink
Writer field: fix content with non-breaking space
Browse files Browse the repository at this point in the history
Fixes #6285
  • Loading branch information
distantnative committed Jul 22, 2024
1 parent 744a004 commit a4f0a46
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion config/fields/writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@
'computed' => [
'value' => function () {
$value = trim($this->value ?? '');
return Sane::sanitize($value, 'html');
$value = Sane::sanitize($value, 'html');

// convert non-breaking spaces to HTML entity
// as that's how ProseMirror handles it internally;
// will allow comparing saved and current content
$value = str_replace(' ', ' ', $value);

return $value;
}
],
'validations' => [
Expand Down

0 comments on commit a4f0a46

Please sign in to comment.