From ed75bb5cd1b3cca908ca7ec0c1b7463ca92dd697 Mon Sep 17 00:00:00 2001 From: Lucas <83518257+luqaska@users.noreply.github.com> Date: Fri, 10 Sep 2021 19:38:15 -0300 Subject: [PATCH] Delete Slimdown.php --- Slimdown.php | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 Slimdown.php diff --git a/Slimdown.php b/Slimdown.php deleted file mode 100644 index 063b648..0000000 --- a/Slimdown.php +++ /dev/null @@ -1,42 +0,0 @@ - - * Website: https://gist.github.com/jbroadway/2836900 - * License: MIT - */ -class Slimdown { - public static $rules = array ( - '/(? '\1', // links - '/(\*\*|__)(.*?)\1/' => '\2', // bold - '/(\*|_)(.*?)\1/' => '\2', // emphasis - '/\~\~(.*?)\~\~/' => '\1', // del - '/\:\"(.*?)\"\:/' => '\1', // quote - '/`(.*?)`/' => '\1', // inline code - '/(?:!\[([^\[]+)\]\(([^\)]+)\))/' => '\'\1\'', - '/==(.*?)==/' => '\1', - ); - - /** - * Add a rule. - */ - public static function add_rule ($regex, $replacement) { - self::$rules[$regex] = $replacement; - } - - /** - * Render some Markdown into HTML. - */ - public static function render ($text) { - $text = "\n" . $text . "\n"; - foreach (self::$rules as $regex => $replacement) { - if (is_callable ( $replacement)) { - $text = preg_replace_callback ($regex, $replacement, $text); - } else { - $text = preg_replace ($regex, $replacement, $text); - } - } - return trim ($text); - } -}