From f0c6e1484c10bcb9538d56e3714e4afc0fe098b7 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Sun, 27 Mar 2022 19:22:48 +0200 Subject: [PATCH] completely rewrote parsing of lists nesting is now possible. we also now have a single function for parsing odered and unoredered lists --- README.md | 6 ++- index.php | 3 +- src/Lexer.php | 6 ++- src/Parser.php | 104 +++++++++++++++++++++++++++++-------------------- src/Token.php | 1 + tests/list.md | 19 +++++++++ 6 files changed, 94 insertions(+), 45 deletions(-) create mode 100644 tests/list.md diff --git a/README.md b/README.md index 7ac3eeb..f6e131b 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,16 @@ Parkdown currently support the following block types: * tables *(with alignment specification)* * paragraphs * block quotes +* lists *(like this one)* +* also nested * horizontal rules `---` +* lol +* bar ### Supported inline types Parkdown currently support the following block types: -* bold text (`**bold**`) +* bold text (`**bold**`) * italic text (`*italic*`) * code snippets * images (`![alt text](src url)`) diff --git a/index.php b/index.php index 23c4906..b70ba78 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,8 @@ require __DIR__."/vendor/autoload.php"; $source = file_get_contents(dirname(__FILE__)."/README.md"); -//$source = file_get_contents(dirname(__FILE__)."/test/paragraph.md"); +//$source = file_get_contents(dirname(__FILE__)."/tests/paragraph.md"); +//$source = file_get_contents(dirname(__FILE__)."/tests/list.md"); echo "