summaryrefslogtreecommitdiffstats
path: root/content.go
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2017-08-24 17:21:03 +0200
committerclsr <clsr@clsr.net>2017-08-24 17:21:03 +0200
commit0cf5f7a9b1fcb272cd9d632bc76219edd7077c39 (patch)
tree106230b508851a313aaab30982402d25085c6378 /content.go
parent4184f047985bb28e79dd11863fe76c71865d89db (diff)
downloadcnm-go-0cf5f7a9b1fcb272cd9d632bc76219edd7077c39.tar.gz
cnm-go-0cf5f7a9b1fcb272cd9d632bc76219edd7077c39.zip
Export WriteIndent
Diffstat (limited to 'content.go')
-rw-r--r--content.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/content.go b/content.go
index c2ba347..6a728f5 100644
--- a/content.go
+++ b/content.go
@@ -41,7 +41,7 @@ type ContentBlock struct {
func (cb *ContentBlock) WriteIndent(w io.Writer, n int) error {
ss := []string{Escape(cb.name)}
ss = append(ss, cb.args...)
- if err := writeIndent(w, JoinEscape(ss), n); err != nil {
+ if err := WriteIndent(w, JoinEscape(ss), n); err != nil {
return err
}
for _, ch := range cb.children {
@@ -169,7 +169,7 @@ func (t *TextBlock) WriteIndent(w io.Writer, n int) error {
if t.Format != "" {
s += " " + Escape(t.Format)
}
- if err := writeIndent(w, s, n); err != nil {
+ if err := WriteIndent(w, s, n); err != nil {
return err
}
if err := t.Contents.WriteIndent(w, n+1); err != nil {
@@ -237,11 +237,11 @@ type TextPlainContents struct {
func (t TextPlainContents) WriteIndent(w io.Writer, n int) error {
for i, p := range t.Paragraphs {
if i != 0 {
- if err := writeIndent(w, "", 0); err != nil {
+ if err := WriteIndent(w, "", 0); err != nil {
return err
}
}
- if err := writeIndent(w, Escape(p), n); err != nil {
+ if err := WriteIndent(w, Escape(p), n); err != nil {
return err
}
}
@@ -299,7 +299,7 @@ type TextPreContents struct {
func (t TextPreContents) WriteIndent(w io.Writer, n int) error {
ss := strings.Split(t.Text, "\n")
for _, s := range ss {
- if err := writeIndent(w, EscapeNonspace(s), n); err != nil {
+ if err := WriteIndent(w, EscapeNonspace(s), n); err != nil {
return err
}
}
@@ -335,7 +335,7 @@ func parseTextPre(p *Parser, block *TokenBlock) (TextContents, error) {
return TextPreContents{strings.Join(lines, "\n")}, err
}
-// TextRawContents represents raw (unesacped) contents of a text or raw block.
+// TextRawContents represents raw contents of a text or raw block.
type TextRawContents struct {
// Text is the raw content.
Text string
@@ -345,7 +345,7 @@ type TextRawContents struct {
func (t TextRawContents) WriteIndent(w io.Writer, n int) error {
ss := strings.Split(t.Text, "\n")
for _, s := range ss {
- if err := writeIndent(w, s, n); err != nil {
+ if err := WriteIndent(w, s, n); err != nil {
return err
}
}
@@ -408,7 +408,7 @@ func (r *RawBlock) WriteIndent(w io.Writer, n int) error {
if r.Syntax != "" {
s += " " + Escape(r.Syntax)
}
- if err := writeIndent(w, s, n); err != nil {
+ if err := WriteIndent(w, s, n); err != nil {
return err
}
r.Contents.WriteIndent(w, n+1)
@@ -487,7 +487,7 @@ func (t *TableBlock) Args() []string {
// WriteIndent writes the table header and contents indented by n tabs.
func (t *TableBlock) WriteIndent(w io.Writer, n int) error {
- if err := writeIndent(w, t.Name(), n); err != nil {
+ if err := WriteIndent(w, t.Name(), n); err != nil {
return err
}
for _, row := range t.rows {
@@ -620,10 +620,10 @@ func (e *EmbedBlock) WriteIndent(w io.Writer, n int) error {
s += Escape(e.Type)
}
s += " " + Escape(e.URL)
- if err := writeIndent(w, s, n); err != nil {
+ if err := WriteIndent(w, s, n); err != nil {
return err
}
- if err := writeIndent(w, Escape(e.Description), n+1); err != nil {
+ if err := WriteIndent(w, Escape(e.Description), n+1); err != nil {
return err
}
return nil