aboutsummaryrefslogtreecommitdiff
path: root/mardown/eval.go
blob: c085767414b331047d17a76665ceb656c7c52b0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package mardown

import "html/template"

func Parse(s string) (template.HTML, *ParseError) {
	lxs := lex(s)
	tree, err := ast(lxs)
	if err != nil {
		return "", err
	}
	return tree.Eval()
}

func ParseBytes(b []byte) (template.HTML, *ParseError) {
	return Parse(string(b))
}