go-org-orgwiki/org/util.go
Niklas Fasching ed8764940f Fix paragraphs: Empty lines separate paragraphs
Somehow i thought it was 2 empty lines rather than 1 - makes more sense this
way... :D
2018-12-03 01:44:35 +01:00

19 lines
412 B
Go

package org
func isSecondBlankLine(d *Document, i int) bool {
if i-1 <= 0 {
return false
}
t1, t2 := d.tokens[i-1], d.tokens[i]
if t1.kind == "text" && t2.kind == "text" && t1.content == "" && t2.content == "" {
return true
}
return false
}
func isEmptyLineParagraph(n Node) bool {
if p, _ := n.(Paragraph); len(p.Children) == 1 {
return len(p.Children[0].(Line).Children) == 0
}
return false
}