style: multiline code blocks
This commit is contained in:
parent
deea763923
commit
8a9b36d3db
@ -139,7 +139,11 @@ function text2html($sz) {
|
|||||||
$btparts = explode('`', $base);
|
$btparts = explode('`', $base);
|
||||||
if (count($btparts) > 1 && (count($btparts) % 2)) {
|
if (count($btparts) > 1 && (count($btparts) % 2)) {
|
||||||
for ($i = 1, $e = count($btparts); $i < $e; $i += 2) {
|
for ($i = 1, $e = count($btparts); $i < $e; $i += 2) {
|
||||||
$btparts[$i] = '<span class="code">'.$btparts[$i].'</span>';
|
$class = 'code';
|
||||||
|
if (strpos($btparts[$i], "\n") !== false) {
|
||||||
|
$class .= ' code-multiline';
|
||||||
|
}
|
||||||
|
$btparts[$i] = '<span class="'.$class.'">'.$btparts[$i].'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,11 @@ h1,h2,h3 {
|
|||||||
font-family:Consolas,monospace;
|
font-family:Consolas,monospace;
|
||||||
white-space:pre;
|
white-space:pre;
|
||||||
}
|
}
|
||||||
|
.code-multiline {
|
||||||
|
display:inline-block;
|
||||||
|
padding:8px;
|
||||||
|
border-radius:8px;
|
||||||
|
}
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user