commit 1f4e0f3f47760216733f337cd0cb0c6642060877
parent 9b4ba2669f26d069d32a1f7fc61c0a73ce0686e9
Author: markseuffert <mark2011@mayberg.se>
Date: Mon, 23 Feb 2026 09:54:37 +0100
Updated Markdown for Steffen, experimental
Diffstat:
5 files changed, 60 insertions(+), 19 deletions(-)
diff --git a/system/extensions/update-available.ini b/system/extensions/update-available.ini
@@ -27,14 +27,14 @@ system/workers/backtotop.js: backtotop.js, create, update
system/workers/backtotop.css: backtotop.css, create, update
Extension: Berlin
-Version: 0.9.5
+Version: 0.9.6
Description: Berlin is a theme inspired by Dieter Rams.
Designer: Anna Svensson
Tag: theme
DownloadUrl: https://github.com/annaesvensson/yellow-berlin/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-berlin
DocumentationLanguage: en, de, sv
-Published: 2025-10-02 00:07:19
+Published: 2026-02-23 09:49:59
Status: available
system/workers/berlin.php: berlin.php, create, update
system/layouts/berlin-default.html: berlin-default.html, create, update, careful
@@ -135,14 +135,14 @@ system/layouts/contact.html: contact.html, create, update, careful
content/contact/page.md: page.md, create, optional
Extension: Copenhagen
-Version: 0.9.5
+Version: 0.9.6
Description: Copenhagen is a beautiful theme.
Designer: Anna Svensson
Tag: theme
DownloadUrl: https://github.com/annaesvensson/yellow-copenhagen/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-copenhagen
DocumentationLanguage: en, de, sv
-Published: 2025-10-02 00:07:19
+Published: 2026-02-23 09:49:58
Status: available
system/workers/copenhagen.php: copenhagen.php, create, update
system/themes/copenhagen.css: copenhagen.css, create, update, careful
@@ -489,14 +489,14 @@ system/themes/karlskrona.css: karlskrona.css, create, update, careful
system/themes/karlskrona.png: karlskrona.png, create
Extension: Markdown
-Version: 0.9.5
+Version: 0.9.6
Description: Text formatting for humans.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-markdown/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-markdown
DocumentationLanguage: en, de, sv
-Published: 2025-11-26 20:39:07
+Published: 2026-02-23 00:57:56
Status: available
system/workers/markdown.php: markdown.php, create, update
@@ -524,14 +524,14 @@ Status: available
system/workers/norwegian.php: norwegian.php, create, update
Extension: Paris
-Version: 0.9.5
+Version: 0.9.6
Description: Paris is an elegant theme.
Designer: Anna Svensson
Tag: theme
DownloadUrl: https://github.com/annaesvensson/yellow-paris/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-paris
DocumentationLanguage: en, de, sv
-Published: 2025-10-02 00:07:19
+Published: 2026-02-23 09:49:56
Status: available
system/workers/paris.php: paris.php, create, update
system/layouts/paris-navigation.html: paris-navigation.html, create, update, careful
@@ -702,14 +702,14 @@ Status: available
system/workers/spanish.php: spanish.php, create, update
Extension: Stockholm
-Version: 0.9.5
+Version: 0.9.6
Description: Stockholm is a clean theme.
Designer: Anna Svensson
Tag: example, theme
DownloadUrl: https://github.com/annaesvensson/yellow-stockholm/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-stockholm
DocumentationLanguage: en, de, sv
-Published: 2025-10-02 00:07:19
+Published: 2026-02-23 09:49:55
Status: available
system/workers/stockholm.php: stockholm.php, create, update
system/themes/stockholm.css: stockholm.css, create, update, careful
diff --git a/system/extensions/update-installed.ini b/system/extensions/update-installed.ini
@@ -87,14 +87,14 @@ media/downloads/yellow-svenska.pdf: yellow-svenska.pdf, create
./robots.txt: robots.txt, create
Extension: Markdown
-Version: 0.9.5
+Version: 0.9.6
Description: Text formatting for humans.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-markdown/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-markdown
DocumentationLanguage: en, de, sv
-Published: 2025-11-26 20:39:07
+Published: 2026-02-23 00:57:56
Status: available
system/workers/markdown.php: markdown.php, create, update
@@ -111,14 +111,14 @@ Status: available
system/workers/serve.php: serve.php, create, update
Extension: Stockholm
-Version: 0.9.5
+Version: 0.9.6
Description: Stockholm is a clean theme.
Designer: Anna Svensson
Tag: example, theme
DownloadUrl: https://github.com/annaesvensson/yellow-stockholm/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-stockholm
DocumentationLanguage: en, de, sv
-Published: 2025-10-02 00:07:19
+Published: 2026-02-23 09:49:55
Status: available
system/workers/stockholm.php: stockholm.php, create, update
system/themes/stockholm.css: stockholm.css, create, update, careful
diff --git a/system/themes/stockholm.css b/system/themes/stockholm.css
@@ -156,6 +156,13 @@ a:hover {
font-weight: bold;
border-left: 3px solid var(--blockquote-accent);
}
+.content details summary {
+ padding-left: inherit;
+ cursor: pointer;
+}
+.content details > * {
+ padding-left: 1em;
+}
.content .important {
margin: 1em 0;
padding: 10px 1em;
diff --git a/system/workers/markdown.php b/system/workers/markdown.php
@@ -2,7 +2,7 @@
// Markdown extension, https://github.com/annaesvensson/yellow-markdown
class YellowMarkdown {
- const VERSION = "0.9.5";
+ const VERSION = "0.9.6";
public $yellow; // access to API
// Handle initialisation
@@ -3847,9 +3847,10 @@ class YellowMarkdownParser extends MarkdownExtraParser {
return $yellow->lookup->normaliseLocation($url, $page->getPage("main")->location);
};
$this->span_gamut += array("doStrikethrough" => 55);
- $this->block_gamut += array("doGeneralBlocks" => 65);
+ $this->block_gamut += array("doCollapsibleBlocks" => 65);
+ $this->block_gamut += array("doGeneralBlocks" => 75);
$this->document_gamut += array("doFootnotesLinks" => 55);
- $this->escape_chars .= "~";
+ $this->escape_chars .= "~?";
parent::__construct();
}
@@ -4001,6 +4002,39 @@ class YellowMarkdownParser extends MarkdownExtraParser {
return preg_replace_callback("/((?>^[ ]*>[ ]?.+\n(.+\n)*)+)/m", array($this, "_doBlockQuotes_callback"), $text);
}
+ // Handle collapsible block elements
+ public function doCollapsibleBlocks($text) {
+ return preg_replace_callback("/((?>^[ ]*\?[ ]?.+\n(.+\n)*)+)/m", array($this, "_doCollapsibleBlocks_callback"), $text);
+ }
+
+ // Handle collapsible block elements over multiple lines
+ public function _doCollapsibleBlocks_callback($matches) {
+ $name = $attributes = $attr = "";
+ $text = preg_replace("/^[ ]*\?[ ]?/m", "", $matches[1]);
+ if (preg_match("/^[ ]*".$this->id_class_attr_catch_re."[ ]*\n([\S\s]*)$/m", $text, $parts)) {
+ $name = $this->getBlockName("", $parts[1]);
+ $text = $parts[2];
+ $attributes = $parts[1];
+ $attr = $this->doExtraAttributes("details", $parts[1]);
+ }
+ if (!is_string_empty($text)) {
+ $output = $this->page->parseContentElement($name, $text, $attributes, "collapsible");
+ if (is_null($output)) {
+ $summary = "";
+ if (preg_match("/^[ ]*(.*?)[ ]*\n(\n*)([\S\s]*)$/m", $text, $parts) && !is_string_empty($parts[2])) {
+ $summary = $parts[1];
+ $text = $parts[3];
+ }
+ $output = "<details$attr>\n";
+ if (!is_string_empty($summary)) $output .= "<summary>".$this->runSpanGamut($summary)."</summary>\n";
+ $output .= $this->runBlockGamut($text)."\n</details>";
+ }
+ } else {
+ $output = "<details$attr></details>";
+ }
+ return "\n".$this->hashBlock($output)."\n\n";
+ }
+
// Handle general block elements
public function doGeneralBlocks($text) {
return preg_replace_callback("/((?>^[ ]*!(?!\[)[ ]?.+\n(.+\n)*)+)/m", array($this, "_doGeneralBlocks_callback"), $text);
@@ -4048,7 +4082,7 @@ class YellowMarkdownParser extends MarkdownExtraParser {
return $text;
}
- // Return suitable name for code block or general block element
+ // Return suitable name for block element
public function getBlockName($language, $attributes) {
if (!is_string_empty($language)) {
$name = ltrim($language, ".");
diff --git a/system/workers/stockholm.php b/system/workers/stockholm.php
@@ -2,7 +2,7 @@
// Stockholm extension, https://github.com/annaesvensson/yellow-stockholm
class YellowStockholm {
- const VERSION = "0.9.5";
+ const VERSION = "0.9.6";
public $yellow; // access to API
// Handle initialisation