1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:34:45 -07:00

present: don't ignore command within text scope

when handling text line by line, the current line will be ignored if it
may be a command line, so we should stack back this line for further parse.

Fixes golang/go#11435

Change-Id: If0567c46c90d09b30e78b72f24395725b9e00ea3
Reviewed-on: https://go-review.googlesource.com/16410
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Tw 2015-10-28 11:29:04 +08:00 committed by Andrew Gerrand
parent 199b70b426
commit 23f9896d9e

View File

@ -362,6 +362,7 @@ func parseSections(ctx *Context, name string, lines *Lines, number []int, doc *D
var l []string
for ok && strings.TrimSpace(text) != "" {
if text[0] == '.' { // Command breaks text block.
lines.back()
break
}
if strings.HasPrefix(text, `\.`) { // Backslash escapes initial period.