mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
Continue fleshing out project management system
This commit is contained in:
parent
657ecc68d4
commit
051e286a6d
19 changed files with 420 additions and 108 deletions
|
@ -82,6 +82,20 @@ class Formatter{
|
|||
return htmlspecialchars(trim($text ?? ''), ENT_QUOTES|ENT_XML1, 'utf-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape a string for use in Markdown.
|
||||
*/
|
||||
public static function EscapeMarkdown(?string $text): string{
|
||||
if($text === null){
|
||||
return '';
|
||||
}
|
||||
|
||||
return str_replace(
|
||||
['\\', '-', '#', '*', '+', '`', '.', '[', ']', '(', ')', '!', '<', '>', '_', '{', '}', '|'],
|
||||
['\\\\', '\-', '\#', '\*', '\+', '\`', '\.', '\[', '\]', '\(', '\)', '\!', '\<', '\>', '\_', '\{', '\}', '\|'],
|
||||
$text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string of Markdown into HTML.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue