<commit_before>package form

import (
	"fmt"
	"io"
)

// FirstLayer Interface
type FirstLayer interface {
	Render(w io.Writer)
}

// First Layer Stack
type FirstLayerStack []FirstLayer

func (f *FirstLayerStack) append(e FirstLayer) {
	*f = append(*f, e)
}

// Render
func (f FirstLayerStack) Render(w io.Writer) {
	for _, item := range f {
		item.Render(w)
	}
}

// First Layer Input
type FirstLayerInput struct {
	Attr  map[string]string
	Label string
}

// Render
func (f *FirstLayerInput) Render(w io.Writer) {
	if f.Label == "" {
		fmt.Fprintf(w, `<input %s/>`, RenderAttr(f.Attr))
	} else {
		fmt.Fprintf(w, `<label><input %s/>%s</label>`, RenderAttr(f.Attr), es(f.Label))
	}
}

// First Layer Textarea
type FirstLayerTextarea struct {
	Attr    map[string]string
	Content string
}

// Render
func (f *FirstLayerTextarea) Render(w io.Writer) {
	fmt.Fprintf(w, `<textarea %s>%s</textare>`, RenderAttr(f.Attr), es(f.Content))
}

// First Layer Select
type FirstLayerSelect struct {
	Attr    map[string]string
	Options []Option
}

// Render<commit_msg>Fixed html leakage issue with textarea<commit_after>package form

import (
	"fmt"
	"io"
)

// FirstLayer Interface
type FirstLayer interface {
	Render(w io.Writer)
}

// First Layer Stack
type FirstLayerStack []FirstLayer

func (f *FirstLayerStack) append(e FirstLayer) {
	*f = append(*f, e)
}

// Render
func (f FirstLayerStack) Render(w io.Writer) {
	for _, item := range f {
		item.Render(w)
	}
}

// First Layer Input
type FirstLayerInput struct {
	Attr  map[string]string
	Label string
}

// Render
func (f *FirstLayerInput) Render(w io.Writer) {
	if f.Label == "" {
		fmt.Fprintf(w, `<input %s/>`, RenderAttr(f.Attr))
	} else {
		fmt.Fprintf(w, `<label><input %s/>%s</label>`, RenderAttr(f.Attr), es(f.Label))
	}
}

// First Layer Textarea
type FirstLayerTextarea struct {
	Attr    map[string]string
	Content string
}

// Render
func (f *FirstLayerTextarea) Render(w io.Writer) {
	fmt.Fprintf(w, `<textarea %s>%s</textarea>`, RenderAttr(f.Attr), es(f.Content))
}

// First Layer Select
type FirstLayerSelect struct {
	Attr    map[string]string
	Options []Option
}

// Render
{'fraction_non_alphanumeric': 0.14995313964386128, 'fraction_numerical': 0.0, 'mean_word_length': 4.011737089201878, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5791041', 'n_tokens_mistral': 792, 'n_tokens_neox': 793, 'n_words': 198}