diff options
Diffstat (limited to 'mardown/eval.go')
| -rw-r--r-- | mardown/eval.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mardown/eval.go b/mardown/eval.go new file mode 100644 index 0000000..c085767 --- /dev/null +++ b/mardown/eval.go @@ -0,0 +1,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)) +} |
