diff --git a/admin/main.php b/admin/main.php
index 049e5a8..000b741 100644
--- a/admin/main.php
+++ b/admin/main.php
@@ -111,13 +111,13 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin
echo '';
// paths: multiline textarea
- $paths = (string)$this->getConf('paths');
+ $paths = $this->normalizeMultilineDisplay((string)$this->getConf('paths'), 'paths');
echo '
';
// scratchpad_paths: multiline textarea
- $scratchpadPaths = (string)$this->getConf('scratchpad_paths');
+ $scratchpadPaths = $this->normalizeMultilineDisplay((string)$this->getConf('scratchpad_paths'), 'scratchpad_paths');
echo '
';
@@ -338,4 +338,24 @@ class admin_plugin_luxtools_main extends DokuWiki_Admin_Plugin
return var_export($value, true);
}
+
+ /**
+ * Strip nowdoc markers from values when displaying in the admin form.
+ *
+ * @param string $value
+ * @param string $key
+ * @return string
+ */
+ protected function normalizeMultilineDisplay(string $value, string $key): string
+ {
+ $marker = strtoupper('LUXTOOLS_' . preg_replace('/[^A-Z0-9_]/i', '_', $key) . '_EOT');
+ $prefix = "<<<'$marker'\n";
+ $suffix = "\n$marker";
+
+ if (str_starts_with($value, $prefix) && str_ends_with($value, $suffix)) {
+ return substr($value, strlen($prefix), -strlen($suffix));
+ }
+
+ return $value;
+ }
}