From 4aafb0de729aaf9c8bc2658b4992ac6a3536d471 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 2 Oct 2025 15:14:01 +0200 Subject: fix(markdown): no error on bad code block pos --- mardown/error.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'mardown/error.go') diff --git a/mardown/error.go b/mardown/error.go index f85dfbb..bdcd9df 100644 --- a/mardown/error.go +++ b/mardown/error.go @@ -24,14 +24,13 @@ func (e *ParseError) Pretty() string { ind := "" for lxs.Next() && lxs.Current().Type != lexerBreak { contxt += lxs.Current().Value - if lxs.current < current { - if lxs.current == current-2 { - ind += "^" - } else { - for range len(lxs.Current().Value) { - ind += "~" - } - } + ln := len(lxs.Current().Value) + if lxs.current == current-1 { + ln-- + ind += "^" + } + for range ln { + ind += "~" } } return fmt.Sprintf("%v\n\n%s\n%s", e, contxt, ind) -- cgit v1.2.3