diff --git a/src/EntityTools.php b/src/EntityTools.php index 21a1ac6..582f62f 100644 --- a/src/EntityTools.php +++ b/src/EntityTools.php @@ -169,15 +169,6 @@ final class EntityTools $what ); } - /** - * Escape string for markdown codeblock. - * - * @param string $what String to escape - */ - public static function markdownCodeblockEscape(string $what): string - { - return \str_replace('```', '\\```', $what); - } /** * Escape string for markdown code section. * @@ -185,7 +176,7 @@ final class EntityTools */ public static function markdownCodeEscape(string $what): string { - return \str_replace('`', '\\`', $what); + return \str_replace(['`', '\\'], ['\\`', '\\\\'], $what); } /** * Escape string for URL. @@ -194,6 +185,6 @@ final class EntityTools */ public static function markdownUrlEscape(string $what): string { - return \str_replace(')', '\\)', $what); + return \str_replace([')', '\\'], ['\\)', '\\\\'], $what); } }