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