markseu il y a 1 an
Parent
commit
1f0eea749c

+ 22 - 1
system/extensions/core.php

@@ -2,7 +2,7 @@
 // Core extension, https://github.com/annaesvensson/yellow-core
 
 class YellowCore {
-    const VERSION = "0.8.130";
+    const VERSION = "0.8.131";
     const RELEASE = "0.8.23";
     public $content;        // content files
     public $media;          // media files
@@ -1659,6 +1659,27 @@ class YellowLookup {
         return $attributes;
     }
     
+    // Return HTML attributes from generic Markdown attributes
+    public function getHtmlAttributes($text) {
+        $htmlAttributes = "";
+        $htmlAttributesData = array();
+        foreach (explode(" ", $text) as $token) {
+            if (substru($token, 0, 1)==".") {
+                if (!isset($htmlAttributesData["class"])) {
+                    $htmlAttributesData["class"] = substru($token, 1);
+                } else {
+                    $htmlAttributesData["class"] .= " ".substru($token, 1);
+                }
+            }
+            if (substru($token, 0, 1)=="#") $htmlAttributesData["id"] = substru($token, 1);
+            if (preg_match("/^([\w]+)=(.+)/", $token, $matches)) $htmlAttributesData[$matches[1]] = $matches[2];
+        }
+        foreach ($htmlAttributesData as $key=>$value) {
+            $htmlAttributes .= " $key=\"".htmlspecialchars($value)."\"";
+        }
+        return $htmlAttributes;
+    }
+    
     // Return MIME header field, encode and fold if necessary
     public function getMimeHeader($text, $field, $allowEncode = true) {
         if ($allowEncode) {

+ 2 - 2
system/extensions/update-available.ini

@@ -148,14 +148,14 @@ system/themes/copenhagen.css: copenhagen.css, create, update, careful
 system/themes/copenhagen.png: copenhagen.png, create
 
 Extension: Core
-Version: 0.8.130
+Version: 0.8.131
 Description: Core functionality of your website.
 Developer: Anna Svensson
 Tag: feature
 DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip
 DocumentationUrl: https://github.com/annaesvensson/yellow-core
 DocumentationLanguage: en, de, sv
-Published: 2024-04-02 11:48:14
+Published: 2024-04-02 20:52:39
 Status: available
 system/extensions/core.php: core.php, create, update
 system/layouts/default.html: default.html, create, update, careful

+ 2 - 2
system/extensions/update-current.ini

@@ -1,14 +1,14 @@
 # Datenstrom Yellow update settings for installed extensions
 
 Extension: Core
-Version: 0.8.130
+Version: 0.8.131
 Description: Core functionality of your website.
 Developer: Anna Svensson
 Tag: feature
 DownloadUrl: https://github.com/annaesvensson/yellow-core/archive/refs/heads/main.zip
 DocumentationUrl: https://github.com/annaesvensson/yellow-core
 DocumentationLanguage: en, de, sv
-Published: 2024-04-02 11:48:14
+Published: 2024-04-02 20:52:39
 Status: available
 system/extensions/core.php: core.php, create, update
 system/layouts/default.html: default.html, create, update, careful