From 1ce93d83321c751265e4207ebf6dc73a280482c6 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Wed, 1 Oct 2025 15:12:36 +0200 Subject: feat(markdown): remove source block in quote if empty --- mardown/ast_quote.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mardown/ast_quote.go') diff --git a/mardown/ast_quote.go b/mardown/ast_quote.go index 5ed1208..d673f61 100644 --- a/mardown/ast_quote.go +++ b/mardown/ast_quote.go @@ -30,7 +30,10 @@ func (a *astQuote) Eval() (template.HTML, error) { source += ct } source = template.HTML(strings.TrimSpace(string(source))) - return template.HTML(fmt.Sprintf(`
%s

%s

`, quote, source)), nil + if len(source) > 0 { + return template.HTML(fmt.Sprintf(`
%s

%s

`, quote, source)), nil + } + return template.HTML(fmt.Sprintf(`
%s
`, quote)), nil } func quote(lxs *lexers) (*astQuote, error) { -- cgit v1.2.3