Update go-org to 0.1.9 (#9782)
* Update go-org to 0.1.9 What I did to generate this commit: $ go get github.com/niklasfasching/go-org * make vendor
This commit is contained in:
parent
3ae5f8ef11
commit
c6a32ddb47
8 changed files with 20 additions and 10 deletions
7
vendor/github.com/niklasfasching/go-org/org/paragraph.go
generated
vendored
7
vendor/github.com/niklasfasching/go-org/org/paragraph.go
generated
vendored
|
@ -1,6 +1,7 @@
|
|||
package org
|
||||
|
||||
import (
|
||||
"math"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
@ -27,12 +28,12 @@ func lexHorizontalRule(line string) (token, bool) {
|
|||
|
||||
func (d *Document) parseParagraph(i int, parentStop stopFn) (int, Node) {
|
||||
lines, start := []string{d.tokens[i].content}, i
|
||||
i++
|
||||
stop := func(d *Document, i int) bool {
|
||||
return parentStop(d, i) || d.tokens[i].kind != "text" || d.tokens[i].content == ""
|
||||
}
|
||||
for ; !stop(d, i); i++ {
|
||||
lines = append(lines, d.tokens[i].content)
|
||||
for i += 1; !stop(d, i); i++ {
|
||||
lvl := math.Max(float64(d.tokens[i].lvl-d.baseLvl), 0)
|
||||
lines = append(lines, strings.Repeat(" ", int(lvl))+d.tokens[i].content)
|
||||
}
|
||||
consumed := i - start
|
||||
return consumed, Paragraph{d.parseInline(strings.Join(lines, "\n"))}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue