From aaa15ce89319eba3ac2b0118c16c63755429a29a Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Tue, 23 Aug 2022 19:23:44 +0200 Subject: [PATCH] added playground for debuggin purposes --- playground/ajax.php | 35 ++++++++ playground/index.php | 204 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 239 insertions(+) create mode 100644 playground/ajax.php create mode 100644 playground/index.php 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