* Website: https://gist.github.com/jbroadway/2836900 * License: MIT */ class Slimdown { public static $rules = array ( '/(#+)(.*)/' => 'self::header', // headers '/\[([^\[]+)\]\(([^\)]+)\)/' => '\1', // links '/(\*\*|__)(.*?)\1/' => '\2', // bold '/(\*|_)(.*?)\1/' => '\2', // emphasis '/\~\~(.*?)\~\~/' => '\1', // del '/\:\"(.*?)\"\:/' => '\1', // quote '/`(.*?)`/' => '\1', // inline code '/\n\*(.*)/' => 'self::ul_list', // ul lists '/\n[0-9]+\.(.*)/' => 'self::ol_list', // ol lists '/\n(>|\>)(.*)/' => 'self::blockquote ', // blockquotes '/\n-{5,}/' => "\n
", // horizontal rule '/\n([^\n]+)\n/' => 'self::para', // add paragraphs '/<\/ul>\s?