1
0
mirror of https://github.com/strongdm/comply synced 2024-11-09 01:14:53 +00:00
comply/vendor/github.com/yosssi/ace/helper_method_css.go

52 lines
1.0 KiB
Go
Raw Normal View History

2018-05-11 20:25:46 +00:00
package ace
import (
"bytes"
"io"
)
// helperMethodCSS represents a helper method css.
type helperMethodCSS struct {
elementBase
}
// WriteTo writes data to w.
func (e *helperMethodCSS) WriteTo(w io.Writer) (int64, error) {
var bf bytes.Buffer
// Write an open tag.
bf.WriteString(lt)
bf.WriteString(`style type="text/css"`)
bf.WriteString(gt)
bf.WriteString(lf)
// Write the children's HTML.
if i, err := e.writeChildren(&bf); err != nil {
return i, err
}
// Write an open tag.
bf.WriteString(lt)
bf.WriteString(slash)
bf.WriteString("style")
bf.WriteString(gt)
// Write the buffer.
i, err := w.Write(bf.Bytes())
return int64(i), err
}
// ContainPlainText returns true.
func (e *helperMethodCSS) ContainPlainText() bool {
return true
}
// helperMethodCSS creates and returns a helper method css.
func newHelperMethodCSS(ln *line, rslt *result, src *source, parent element, opts *Options) *helperMethodCSS {
return &helperMethodCSS{
elementBase: newElementBase(ln, rslt, src, parent, opts),
}
}