aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_quote.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-01 15:12:36 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-01 15:12:36 +0200
commit1ce93d83321c751265e4207ebf6dc73a280482c6 (patch)
tree6cc523fc280f503019822ac31b5d0d6c89e9c5dc /mardown/ast_quote.go
parent511ad88f6bf7b0ec971df407469c494d9dcb139e (diff)
feat(markdown): remove source block in quote if empty
Diffstat (limited to 'mardown/ast_quote.go')
-rw-r--r--mardown/ast_quote.go5
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) {