Преглед изворни кода

Support %config.*% Markdown placeholders

Daniel Rudolf пре 6 година
родитељ
комит
34ae8e8812
1 измењених фајлова са 7 додато и 0 уклоњено
  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);
     }