File: parse.go

package info (click to toggle)
tml 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: makefile: 16
file content (15 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package tml

import (
	"strings"
	"bytes"
)

// Parse converts the input string (containing TML tags) into a string containing ANSI escape code sequences for output to the terminal.
func Parse(input string) (string, error) {
	output := bytes.NewBufferString("")
	if err := NewParser(output).Parse(strings.NewReader(input)); err != nil {
		return "", err
	}
	return output.String(), nil
}