Add basic support for statistic tokens (e.g. [100%] [1/1])
Org mode does not care where those tokens are when it comes to the export (afaict). We'll do the same. (They should only be in the first line of a list item or a headline)
This commit is contained in:
parent
dce67eaddf
commit
a60f844e38
6 changed files with 59 additions and 6 deletions
|
@ -86,6 +86,8 @@ func (w *OrgWriter) writeNodes(ns ...Node) {
|
|||
w.writeText(n)
|
||||
case Emphasis:
|
||||
w.writeEmphasis(n)
|
||||
case StatisticToken:
|
||||
w.writeStatisticToken(n)
|
||||
case LineBreak:
|
||||
w.writeLineBreak(n)
|
||||
case ExplicitLineBreak:
|
||||
|
@ -285,6 +287,10 @@ func (w *OrgWriter) writeEmphasis(e Emphasis) {
|
|||
w.WriteString(borders[1])
|
||||
}
|
||||
|
||||
func (w *OrgWriter) writeStatisticToken(s StatisticToken) {
|
||||
w.WriteString(fmt.Sprintf("[%s]", s.Content))
|
||||
}
|
||||
|
||||
func (w *OrgWriter) writeLineBreak(l LineBreak) {
|
||||
w.WriteString(strings.Repeat("\n"+w.indent, l.Count))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue