mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00: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:
parent
199b70b426
commit
23f9896d9e
@ -362,6 +362,7 @@ func parseSections(ctx *Context, name string, lines *Lines, number []int, doc *D
|
|||||||
var l []string
|
var l []string
|
||||||
for ok && strings.TrimSpace(text) != "" {
|
for ok && strings.TrimSpace(text) != "" {
|
||||||
if text[0] == '.' { // Command breaks text block.
|
if text[0] == '.' { // Command breaks text block.
|
||||||
|
lines.back()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(text, `\.`) { // Backslash escapes initial period.
|
if strings.HasPrefix(text, `\.`) { // Backslash escapes initial period.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user