-
Notifications
You must be signed in to change notification settings - Fork 89
/
helper_method_css.go
51 lines (40 loc) · 1.01 KB
/
helper_method_css.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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),
}
}