Skip to content

Commit

Permalink
Parses Markdown in SMF\Tasks\CreatePost_Notify
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Dec 2, 2024
1 parent 3148170 commit 3e13f00
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Tasks/CreatePost_Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ protected function handleWatchedNotifications(): void
Lang::censorText($parsed_message[$localization]['subject']);
Lang::censorText($parsed_message[$localization]['body']);

if (!empty(Config::$modSettings['enableMarkdown'])) {
$parsed_message[$localization]['subject'] = MarkdownParser::load(MarkdownParser::OUTPUT_BBC)->parse($parsed_message[$localization]['subject'], false);
$parsed_message[$localization]['body'] = MarkdownParser::load(MarkdownParser::OUTPUT_BBC)->parse($parsed_message[$localization]['body'], false);
}

$parsed_message[$localization]['subject'] = Utils::htmlspecialcharsDecode($parsed_message[$localization]['subject']);
$parsed_message[$localization]['body'] = trim(Utils::htmlspecialcharsDecode(strip_tags(strtr($bbcparser->parse($parsed_message[$localization]['body'], false), ['<br>' => "\n", '</div>' => "\n", '</li>' => "\n", '&#91;' => '[', '&#93;' => ']', '&#39;' => '\'', '</tr>' => "\n", '</td>' => "\t", '<hr>' => "\n---------------------------------------------------------------\n"]))));
}
Expand Down

0 comments on commit 3e13f00

Please sign in to comment.