Skip to content

Commit

Permalink
feat: use Parser::bbc on status body content
Browse files Browse the repository at this point in the history
  • Loading branch information
MissAllSunday committed Jun 25, 2024
1 parent 705ff42 commit 7f1048b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/Breeze/Breeze.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions Sources/Breeze/Model/StatusModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Breeze\Entity\LikeEntity;
use Breeze\Entity\StatusEntity as StatusEntity;
use Breeze\Util\Parser;

class StatusModel extends BaseModel implements StatusModelInterface
{
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion Sources/Breeze/Util/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class Parser
{
public static function parse(string $content): string
public static function bbc(string $content): string
{
return parse_bbc($content);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Editor: React.FunctionComponent<any> = (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]);
Expand Down
4 changes: 1 addition & 3 deletions src/components/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ function Status(props: StatusProps): React.ReactElement {
<UserInfo userData={props.status.userData} />
</div>
<div className="windowbg floatright">
<div className="content" title={timeStamp.toLocaleString()}>
{props.status.body}
</div>
<div className="content" title={timeStamp.toLocaleString()} dangerouslySetInnerHTML={{ __html: props.status.body }} />
<div className="half_content">
{ permissions.isEnable.enableLikes && permissions.Forum.likesLike && <Like
item={props.status.likesInfo}
Expand Down

0 comments on commit 7f1048b

Please sign in to comment.