present: retain complete caption command when parsing captions

Updates golang/go#41883

Change-Id: I332aa821a6e414a77ff8d8cc384ba23b5955b05b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/260897
Run-TryBot: Ian Lance Taylor <iant@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Dan Kortschak 2020-10-09 22:02:31 +10:30 committed by Ian Lance Taylor
parent 1aac171fc6
commit a14ff98a4d
1 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ type Caption struct {
func (c Caption) PresentCmd() string { return c.Cmd }
func (c Caption) TemplateName() string { return "caption" }
func parseCaption(_ *Context, _ string, _ int, text string) (Elem, error) {
text = strings.TrimSpace(strings.TrimPrefix(text, ".caption"))
return Caption{text, text}, nil
func parseCaption(_ *Context, _ string, _ int, cmd string) (Elem, error) {
text := strings.TrimSpace(strings.TrimPrefix(cmd, ".caption"))
return Caption{cmd, text}, nil
}