Support keywords without a value like "#+RESULTS:"
This commit is contained in:
parent
9826aa2143
commit
04db858934
1 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ type NodeWithMeta struct {
|
||||||
|
|
||||||
type Comment struct{ Content string }
|
type Comment struct{ Content string }
|
||||||
|
|
||||||
var keywordRegexp = regexp.MustCompile(`^(\s*)#\+([^:]+):\s(.*)`)
|
var keywordRegexp = regexp.MustCompile(`^(\s*)#\+([^:]+):(\s+(.*)|(\s*)$)`)
|
||||||
var commentRegexp = regexp.MustCompile(`^(\s*)#(.*)`)
|
var commentRegexp = regexp.MustCompile(`^(\s*)#(.*)`)
|
||||||
var affiliatedKeywordRegexp = regexp.MustCompile(`^(CAPTION)$`)
|
var affiliatedKeywordRegexp = regexp.MustCompile(`^(CAPTION)$`)
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ func (d *Document) parseAffiliated(i int, stop stopFn) (int, Node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseKeyword(t token) Keyword {
|
func parseKeyword(t token) Keyword {
|
||||||
k, v := t.matches[2], t.matches[3]
|
k, v := t.matches[2], t.matches[4]
|
||||||
k = strings.ToUpper(k)
|
k = strings.ToUpper(k)
|
||||||
return Keyword{k, v}
|
return Keyword{k, v}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue