summaryrefslogtreecommitdiff
path: root/document_parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'document_parser.go')
-rw-r--r--document_parser.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/document_parser.go b/document_parser.go
index 1117b99..3ccfa0f 100644
--- a/document_parser.go
+++ b/document_parser.go
@@ -136,17 +136,22 @@ func (docp *documentParser) hasPreamble() bool {
var (
start = docp.lineNum
- line []byte
- kind int
+ notEmtpy int
+ line []byte
+ kind int
)
for ; start < len(docp.lines); start++ {
line = docp.lines[start]
+ if len(line) == 0 {
+ continue
+ }
kind, _, _ = whatKindOfLine(line)
if kind == elKindSectionL1 || kind == elKindSectionL2 ||
kind == elKindSectionL3 || kind == elKindSectionL4 ||
kind == elKindSectionL5 {
- return true
+ return notEmtpy > 0
}
+ notEmtpy++
}
return false
}