From 7f1048b6a29df98b6ab5337937060a4d2e1514eb Mon Sep 17 00:00:00 2001 From: Michel Mendiola Date: Tue, 25 Jun 2024 14:23:53 -0600 Subject: [PATCH] feat: use Parser::bbc on status body content --- Sources/Breeze/Breeze.php | 2 +- Sources/Breeze/Model/StatusModel.php | 2 ++ Sources/Breeze/Util/Parser.php | 2 +- src/components/Editor.tsx | 2 +- src/components/Status.tsx | 4 +--- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Breeze/Breeze.php b/Sources/Breeze/Breeze.php index 59ade21ce..7181d221c 100644 --- a/Sources/Breeze/Breeze.php +++ b/Sources/Breeze/Breeze.php @@ -38,7 +38,7 @@ class Breeze public const SUPPORT_URL = 'https://missallsunday.com'; public const REACT_DOM_VERSION = '18.2.0'; public const REACT_VERSION = '18.2.0'; - public const REACT_HASH = '3a76fca2'; + public const REACT_HASH = '158501c6'; public const ACTIONS = [ 'breezeStatus', 'breezeComment', diff --git a/Sources/Breeze/Model/StatusModel.php b/Sources/Breeze/Model/StatusModel.php index 4d489e501..08f9ee278 100644 --- a/Sources/Breeze/Model/StatusModel.php +++ b/Sources/Breeze/Model/StatusModel.php @@ -6,6 +6,7 @@ use Breeze\Entity\LikeEntity; use Breeze\Entity\StatusEntity as StatusEntity; +use Breeze\Util\Parser; class StatusModel extends BaseModel implements StatusModelInterface { @@ -99,6 +100,7 @@ private function prepareData(object $request): array $status[$row[StatusEntity::ID]] = array_map(function ($column) { return ctype_digit($column) ? ( (int) $column) : $column; }, $row); + $status[$row[StatusEntity::ID]][StatusEntity::BODY] = Parser::bbc($row[StatusEntity::BODY]); $usersIds[] = $row[StatusEntity::WALL_ID]; $usersIds[] = $row[StatusEntity::USER_ID]; diff --git a/Sources/Breeze/Util/Parser.php b/Sources/Breeze/Util/Parser.php index 80ba001a3..c37db253a 100644 --- a/Sources/Breeze/Util/Parser.php +++ b/Sources/Breeze/Util/Parser.php @@ -7,7 +7,7 @@ class Parser { - public static function parse(string $content): string + public static function bbc(string $content): string { return parse_bbc($content); } diff --git a/src/components/Editor.tsx b/src/components/Editor.tsx index 1b8a72b39..8f6f626ac 100644 --- a/src/components/Editor.tsx +++ b/src/components/Editor.tsx @@ -20,7 +20,7 @@ const Editor: React.FunctionComponent = (props: { saveContent: (content: st smfVars.smfEditorHandler.instance(textArea.current).createPermanentDropDown(); } - if (smfVars.editorIsRich) { + if (!smfVars.editorIsRich) { smfVars.smfEditorHandler.instance(textArea.current).toggleSourceMode(); } }, [props.isFull, textArea]); diff --git a/src/components/Status.tsx b/src/components/Status.tsx index 381385e74..865b7d85a 100644 --- a/src/components/Status.tsx +++ b/src/components/Status.tsx @@ -93,9 +93,7 @@ function Status(props: StatusProps): React.ReactElement {
-
- {props.status.body} -
+
{ permissions.isEnable.enableLikes && permissions.Forum.likesLike &&