I didn't have a test case for this and broke it when i introduced Line nodes to support printing back to org mode. Oops
24 lines
509 B
Go
24 lines
509 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 {
|
|
p, ok := n.(Paragraph)
|
|
return ok && len(p.Children) == 0
|
|
}
|
|
|
|
func isImageOrVideoLink(n Node) bool {
|
|
if l, ok := n.(RegularLink); ok && l.Kind() == "video" || l.Kind() == "image" {
|
|
return true
|
|
}
|
|
return false
|
|
}
|