From deb20fdfca35c64066fe4e375099350dc77ea408 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 22 May 2023 15:18:52 -0500 Subject: initial commit --- _functions/parseMarkdown.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 _functions/parseMarkdown.php (limited to '_functions/parseMarkdown.php') diff --git a/_functions/parseMarkdown.php b/_functions/parseMarkdown.php new file mode 100644 index 0000000..6ca15d8 --- /dev/null +++ b/_functions/parseMarkdown.php @@ -0,0 +1,21 @@ +text($fileContents); + $html = new DOMDocument(); + $html->loadHTML($md); + $html_links = $html->getElementsByTagName('a'); + foreach ($html_links as $html_ink) { + $html_ink->setAttribute('rel', 'noopener,noreferrer'); + $html_ink->setAttribute('target', '_blank'); + } + return $html->saveHTML(); +} \ No newline at end of file -- cgit v1.2.3-70-g09d2