From 763500ba5b4eed3cbd5ad56751ff7ba0bb2fb571 Mon Sep 17 00:00:00 2001 From: pythonian23 Date: Tue, 17 May 2022 12:47:19 +0900 Subject: [PATCH] Unordered lists --- render.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/render.go b/render.go index 9b40b46..3c247ca 100644 --- a/render.go +++ b/render.go @@ -27,7 +27,9 @@ PartLoop: } var tokens = [...]string{ - "```", // codeBlock + "```", // codeBlock + "\n* ", // uList + "\n- ", // uList (same variable as above) "\n\n", "**", // boldA "__", // underline @@ -106,6 +108,15 @@ func Render(md string) string { switch part { case "```": current.codeBlock = !current.codeBlock + case "\n* ": + fallthrough + case "\n- ": + if header { + headerLevel = 0 + header = false + } + out += escape("0", "1") + "\n - " + escape("0") + styleReset = true case "**": current.boldA = !current.boldA case "__":