move formatting from JS to PHP
[mdref/mdref] / mdref / Structure.php
index 2f1a184f1afb387f21287501be2ddf27fed038d3..ace780b4d0c62b340be869c124cdefebc3132cda 100644 (file)
@@ -129,7 +129,9 @@ class Structure {
        private function getConstants() : array {
                static $pattern = '/
                        \*\s+
+                       (?:[<]span[ ]class="constant"[>])?
                        (?<name>\w+)
+                       (?:[<]\/span[>])?
                        (?:\s*=\s*(?P<value>.+))?
                        (?P<desc>(?:\s*\n\s*[^\*\n#].*)*)
                /x';
@@ -492,7 +494,7 @@ class StructureOfVar extends StructureOf {
                $indent = str_repeat("\t", $level);
                $this->formatDesc($level,
                        preg_split('/\s+/', $this->modifiers ." " . $this->usages, -1, PREG_SPLIT_NO_EMPTY)
-                       + [-1 => "var " . $this->saneType($this->type)]
+                       + [-1 => "var " . $this->saneType($this->type, false)]
                );
                printf("%s%s %s", $indent, $this->modifiers, $this->name);
                $this->formatDefval();