From 8a9b36d3dbafa2ea87bfea1d64fbe8ec6ec0faeb Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 8 Nov 2015 11:35:07 +1300 Subject: [PATCH] style: multiline code blocks --- rebuild.php | 6 +++++- sites/code.ivysaur.me/static/style.css | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/rebuild.php b/rebuild.php index 967d50f..19ebb9b 100644 --- a/rebuild.php +++ b/rebuild.php @@ -139,7 +139,11 @@ function text2html($sz) { $btparts = explode('`', $base); if (count($btparts) > 1 && (count($btparts) % 2)) { for ($i = 1, $e = count($btparts); $i < $e; $i += 2) { - $btparts[$i] = ''.$btparts[$i].''; + $class = 'code'; + if (strpos($btparts[$i], "\n") !== false) { + $class .= ' code-multiline'; + } + $btparts[$i] = ''.$btparts[$i].''; } } diff --git a/sites/code.ivysaur.me/static/style.css b/sites/code.ivysaur.me/static/style.css index 2ed1c0a..de14bb5 100644 --- a/sites/code.ivysaur.me/static/style.css +++ b/sites/code.ivysaur.me/static/style.css @@ -29,6 +29,11 @@ h1,h2,h3 { font-family:Consolas,monospace; white-space:pre; } +.code-multiline { + display:inline-block; + padding:8px; + border-radius:8px; +} /* */