diff options
-rw-r--r-- | app/class/Config.php | 13 | ||||
-rw-r--r-- | app/class/Modelrender.php | 2 | ||||
-rw-r--r-- | app/view/templates/admin.php | 12 |
3 files changed, 25 insertions, 2 deletions
diff --git a/app/class/Config.php b/app/class/Config.php index c7d1a78..5c5fe76 100644 --- a/app/class/Config.php +++ b/app/class/Config.php @@ -36,6 +36,9 @@ abstract class Config /** @var string|false $debug */ protected static $debug = false; + /** Database config */ + protected static $markdownhardwrap = true; + public const SECRET_KEY_MIN = 16; public const SECRET_KEY_MAX = 128; @@ -276,6 +279,11 @@ abstract class Config return self::$debug; } + public static function markdownhardwrap() + { + return self::$markdownhardwrap; + } + // __________________________________________ S E T ______________________________________ @@ -481,6 +489,11 @@ abstract class Config } } + public static function setmarkdownhardwrap($markdownhardwrap) + { + self::$markdownhardwrap = boolval($markdownhardwrap); + } + diff --git a/app/class/Modelrender.php b/app/class/Modelrender.php index fd8531a..b3ecb60 100644 --- a/app/class/Modelrender.php +++ b/app/class/Modelrender.php @@ -491,7 +491,7 @@ class Modelrender extends Modelpage // $fortin->header_id_func = function ($header) { // return preg_replace('/[^\w]/', '', strtolower($header)); // }; - $fortin->hard_wrap = true; + $fortin->hard_wrap = Config::markdownhardwrap(); $text = $fortin->transform($text); return $text; } diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php index ab35bd0..adda7f8 100644 --- a/app/view/templates/admin.php +++ b/app/view/templates/admin.php @@ -185,7 +185,17 @@ <label for="internallinkblank">Open internal links in new tab</label> </div> - <i>(This modifications need re-rendering)</i> + <h4>Markdown Parser</h4> + + <div class="checkbox"> + <input type="hidden" name="markdownhardwrap" value="0" form="admin"> + <input type="checkbox" name="markdownhardwrap" id="markdownhardwrap" value="1" <?= Wcms\Config::markdownhardwrap() ? 'checked' : '' ?> form="admin"> + <label for="markdownhardwrap" title="When activated, single line break will be rendered as <br/>" >Render soft-linebreaks as <br/></label> + </div> + + <p> + <i>(This modifications need re-rendering)</i> + </p> |