Selaa lähdekoodia

Support %config.*% Markdown placeholders

Daniel Rudolf 6 vuotta sitten
vanhempi
commit
34ae8e8812
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      lib/Pico.php

+ 7 - 0
lib/Pico.php

@@ -1495,6 +1495,13 @@ class Pico
             }
             }
         }
         }
 
 
+        // replace %config.*%
+        foreach ($this->config as $configKey => $configValue) {
+            if (is_scalar($configValue) || ($configValue === null)) {
+                $variables['%config.' . $configKey . '%'] = (string) $configValue;
+            }
+        }
+
         return str_replace(array_keys($variables), $variables, $markdown);
         return str_replace(array_keys($variables), $variables, $markdown);
     }
     }