From f4e0b415acc0daf7cc7bc3361fd33808d6b1c7e4 Mon Sep 17 00:00:00 2001 From: 8chan Date: Fri, 30 Jan 2015 21:12:03 -0800 Subject: [PATCH] [aa] tags - ASCII art --- inc/config.php | 24 ++++++++++++++++++++++++ stylesheets/style.css | 8 ++++++++ 2 files changed, 32 insertions(+) diff --git a/inc/config.php b/inc/config.php index 5cee7ce1..812d0558 100644 --- a/inc/config.php +++ b/inc/config.php @@ -633,6 +633,30 @@ * ==================== */ + // JIS ASCII art. This *must* be the first markup or it won't work. + $config['markup'][] = array( + "/\[(aa|code)\](.+?)\[\/(?:aa|code)\]/ms", + function($matches) { + $markupchars = array('_', '\'', '~', '*', '='); + $replacement = $markupchars; + array_walk($replacement, function(&$v) { + $v = "&#".ord($v).";"; + }); + + // These are hacky fixes for ###board-tags### and >quotes. + $markupchars[] = '###'; + $replacement[] = '###'; + $markupchars[] = '>'; + $replacement[] = '>'; + + if ($matches[1] === 'aa') { + return '' . str_replace($markupchars, $replacement, $matches[2]) . ''; + } else { + return str_replace($markupchars, $replacement, $matches[0]); + } + } + ); + // "Wiki" markup syntax ($config['wiki_markup'] in pervious versions): $config['markup'][] = array("/'''(.+?)'''/", "\$1"); $config['markup'][] = array("/''(.+?)''/", "\$1"); diff --git a/stylesheets/style.css b/stylesheets/style.css index bd97e099..bd899756 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -1016,4 +1016,12 @@ span.pln { } div.mix { display: inline-block; +} + +/* Mona Font */ + +.aa { + font-family: Mona, "MS PGothic", "MS Pゴシック", sans-serif; + display: block!important; + font-size: 12pt; }