浏览代码

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);
     }