diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-01 15:12:36 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-10-01 15:12:36 +0200 |
| commit | 1ce93d83321c751265e4207ebf6dc73a280482c6 (patch) | |
| tree | 6cc523fc280f503019822ac31b5d0d6c89e9c5dc /mardown/ast_quote.go | |
| parent | 511ad88f6bf7b0ec971df407469c494d9dcb139e (diff) | |
feat(markdown): remove source block in quote if empty
Diffstat (limited to 'mardown/ast_quote.go')
| -rw-r--r-- | mardown/ast_quote.go | 5 |
1 files changed, 4 insertions, 1 deletions
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(`<div class="quote">%s<p>%s</p></div>`, quote, source)), nil + if len(source) > 0 { + return template.HTML(fmt.Sprintf(`<div class="quote">%s<p>%s</p></div>`, quote, source)), nil + } + return template.HTML(fmt.Sprintf(`<div class="quote">%s</div>`, quote)), nil } func quote(lxs *lexers) (*astQuote, error) { |
