diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-02-05 10:50:12 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-02-05 16:36:41 +0000 |
| commit | d6e75145e54854484f2114398ff89787d243608a (patch) | |
| tree | e79dc8d4cc0a25767dff618405bb8d982800229a /markdown/ast.go | |
| parent | cd3bd5dff64fa80c7170d7f5d2d05f610fec36ee (diff) | |
feat(markdown): interprate callout
Diffstat (limited to 'markdown/ast.go')
| -rw-r--r-- | markdown/ast.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/markdown/ast.go b/markdown/ast.go index b78104c..f977228 100644 --- a/markdown/ast.go +++ b/markdown/ast.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "html/template" + "strings" ) var ErrUnkownLexType = errors.New("unkown lex type") @@ -106,3 +107,15 @@ func getBlock(lxs *lexers, newLine bool) (block, *ParseError) { } return b, err } + +func evalBlock(bs []*astParagraph, opt *Option) (template.HTML, *ParseError) { + var sb strings.Builder + for _, c := range bs { + ct, err := c.Eval(opt) + if err != nil { + return "", err + } + sb.WriteString(string(ct)) + } + return template.HTML(strings.TrimSpace(sb.String())), nil +} |
