1// Copyright 2012 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package present
6
7import "strings"
8
9func init() {
10	Register("caption", parseCaption)
11}
12
13type Caption struct {
14	Text string
15}
16
17func (c Caption) TemplateName() string { return "caption" }
18
19func parseCaption(_ *Context, _ string, _ int, text string) (Elem, error) {
20	text = strings.TrimSpace(strings.TrimPrefix(text, ".caption"))
21	return Caption{text}, nil
22}
23