Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0309030f6 | |||
| 929b6401cc | |||
| ae97b9e464 | |||
| 692d4c3482 |
@@ -1,9 +1,9 @@
|
||||
# unmarkdorn
|
||||
# unmarkdown
|
||||
Library for escaping all markdown symbols
|
||||
|
||||
```php
|
||||
// Library for escaping all markdown symbols
|
||||
use mirzaev\unmarkdown\unmarkdown;
|
||||
use function mirzaev\unmarkdown;
|
||||
|
||||
var_dump(unmarkdown('*Hello!*')); // "\\*Hello\\!\\*"
|
||||
```
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace mirzaev;
|
||||
* @return string Escaped text
|
||||
*/
|
||||
function unmarkdown(string $text, array $exceptions = []): string
|
||||
{
|
||||
{
|
||||
// Initializing the registry of characters for escaping
|
||||
$from = array_diff(
|
||||
[
|
||||
@@ -33,7 +33,7 @@ function unmarkdown(string $text, array $exceptions = []): string
|
||||
'<',
|
||||
'!',
|
||||
'`',
|
||||
'\\',
|
||||
'\\\\',
|
||||
'|',
|
||||
'+'
|
||||
],
|
||||
@@ -46,4 +46,4 @@ function unmarkdown(string $text, array $exceptions = []): string
|
||||
|
||||
// Escaping the text and exit (success)
|
||||
return str_replace($from, $to, $text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user