Updated Markdown extension and themes

This commit is contained in:
markseu 2019-05-25 00:09:06 +02:00
parent c7d3974184
commit fceb5c4c87
3 changed files with 59 additions and 29 deletions

View file

@ -4,7 +4,7 @@
// This file may be used and distributed under the terms of the public license.
class YellowMarkdown {
const VERSION = "0.8.5";
const VERSION = "0.8.6";
const TYPE = "feature";
public $yellow; //access to API
@ -3900,28 +3900,34 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser {
// Handle notice blocks
public function doNoticeBlocks($text) {
return preg_replace_callback("/((?>^[ ]*!.+\n(.+\n)*\n*)+)/m", array($this, "_doNoticeBlocks_callback"), $text);
return preg_replace_callback("/((?>^[ ]*!{1,6}.*\n)+)/m", array($this, "_doNoticeBlocks_callback"), $text);
}
// Handle notice blocks over multiple lines
public function _doNoticeBlocks_callback($matches) {
$output = $class = $text = "";
$output = $openerLength = $attr = $text = "";
foreach (preg_split("/\n/", $matches[1]) as $line) {
if (preg_match("/^[ ]*(!{1,6})([\w\-]*)[ ]?(.*)$/", $line, $matches)) {
$classNew = empty($matches[2]) ? "notice-".strlen($matches[1]) : $matches[2];
if ($classNew!=$class) {
if (!empty($class) && !empty($text)) {
$line = "<div class=\"$class\">\n".$this->runBlockGamut($text)."\n</div>";
if (preg_match("/^[ ]*(!{1,6})[ ]?(.*)$/", $line, $matches)) {
$openerLengthNew = strlen($matches[1]);
if ($openerLengthNew!=$openerLength) {
if (!empty($text)) {
$line = "<div$attr>\n".$this->runBlockGamut($text)."\n</div>";
$output .= "\n".$this->hashBlock($line)."\n\n";
}
$class = $classNew;
$text = "";
$openerLength = $openerLengthNew;
$attr = " class=\"notice$openerLength\"";
$text = $matches[2]."\n";
if (preg_match("/^[ ]*".$this->id_class_attr_catch_re."[ ]*$/", $text, $matches)) {
$attr = $this->doExtraAttributes("div", $dummy =& $matches[1]);
$text = "";
}
} else {
$text .= $matches[2]."\n";
}
}
$text .= $matches[3]."\n";
}
if (!empty($class) && !empty($text)) {
$line = "<div class=\"$class\">\n".$this->runBlockGamut($text)."\n</div>";
if (!empty($text)) {
$line = "<div$attr>\n".$this->runBlockGamut($text)."\n</div>";
$output .= "\n".$this->hashBlock($line)."\n\n";
}
return $output;

View file

@ -4,7 +4,7 @@
// This file may be used and distributed under the terms of the public license.
class YellowStockholm {
const VERSION = "0.8.3";
const VERSION = "0.8.4";
const TYPE = "theme";
public $yellow; //access to API

View file

@ -101,18 +101,6 @@ a:hover {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
.content blockquote {
margin-left: 0;
padding-left: 1em;
border-left: 0.5em solid #0a0;
}
.content blockquote blockquote {
margin-left: -1.5em;
border-left: 0.5em solid #fb0;
}
.content blockquote blockquote blockquote {
border-color: #d00;
}
.content code,
.content pre {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
@ -139,6 +127,35 @@ a:hover {
background-color: #f7f7f7;
border-radius: 3px;
}
.content blockquote {
margin-left: 0;
padding-left: 1em;
border-left: 1px solid #ddd;
}
.content .notice1 {
margin: 1em 0;
padding: 10px 1em;
background-color: #fffbf0;
color: #e90;
border-left: 10px solid #fb0;
}
.content .notice2 {
margin: 1em 0;
padding: 10px 1em;
background-color: #fdf0f0;
color: #c00;
border-left: 10px solid #d00;
}
.content .notice3,
.content .notice4,
.content .notice5,
.content .notice6 {
margin: 1em 0;
padding: 10px 1em;
background-color: #f0f8fe;
color: #07d;
border-left: 10px solid #08e;
}
.content .flexible {
position: relative;
padding-top: 0;
@ -438,9 +455,6 @@ a:hover {
/* Misc */
.layout-default .content img.screenshot {
margin: 0 -0.5em;
}
.layout-language .content div.language {
font-size: 1.2em;
text-align: left;
@ -455,6 +469,11 @@ a:hover {
margin-top: -5px;
margin-right: 1.5em;
}
.content .main .wikipages ul,
.content .main .wikitags ul,
.content .main .wikilinks ul {
columns: 3;
}
.hljs-meta,
.hljs-keyword,
.hljs-literal {
@ -533,6 +552,11 @@ a:hover {
.with-sidebar .sidebar {
display: none;
}
.content .main .wikipages ul,
.content .main .wikitags ul,
.content .main .wikilinks ul {
columns: 1;
}
}
@media print {
.page {