From 06bbaf5f97811ec8854a4f8a964e98badce565cb Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 21 Feb 2021 01:57:15 +0100 Subject: [PATCH] Ad doption to set start character on an unordered list in md output --- MDFormatter.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MDFormatter.php b/MDFormatter.php index 22908c1..404680c 100644 --- a/MDFormatter.php +++ b/MDFormatter.php @@ -143,18 +143,19 @@ final class MDFormatter { /** * Applies markdown formatting for an unordered list item. * - * @param string $content Content of the list item. + * @param string $content Content of the list item. + * @param string $delimiter Starting character of a line. * * @return string */ - public static function formatMarkdownUnorderedListItem(string $content):string { + public static function formatMarkdownUnorderedListItem(string $content, string $delimiter = '-'):string { if (\strpos($content, PHP_EOL) === false) { - return '- ' . $content . PHP_EOL; + return $delimiter . ' ' . $content . PHP_EOL; } $lines = \explode(PHP_EOL, $content); - $output = '- ' . $lines[0] . PHP_EOL; + $output = $delimiter . ' ' . $lines[0] . PHP_EOL; foreach ($lines as $i => $line) { if ($i === 0) continue;