diff --git a/playground/ajax.php b/playground/ajax.php new file mode 100644 index 0000000..34f59fe --- /dev/null +++ b/playground/ajax.php @@ -0,0 +1,35 @@ +html(); +} catch (parkdown\ParserError $error) { + echo "
";
+
+	$message     = explode(" ", $error->getMessage());
+	$location    = array_shift($message);
+	$loc         = explode(":", $location);
+	$file        = array_shift($loc);
+	$line        = substr(implode(":", $loc), 0, -1);
+	[$row, $col] = explode(":", $line);
+
+	echo "$location ".implode(" ", $message);
+
+	
+	$stackTrace = explode("\n", $error->getTraceAsString());
+
+	echo "

"; + foreach ($stackTrace as $step) { + $step = explode(" ", $step); + array_shift($step); + $location = array_shift($step); + $location = preg_replace("/\(([0-9]+)\):/", ":\$1:", $location); + + echo "$location ".implode(" ", $step)."
"; + } + echo "

"; +} \ No newline at end of file diff --git a/playground/index.php b/playground/index.php new file mode 100644 index 0000000..a933707 --- /dev/null +++ b/playground/index.php @@ -0,0 +1,204 @@ + + + + + + parkdown playground + + + + + +
+
1
+ +
+
+ + + \ No newline at end of file