func (r *renderer) Text(txt []byte, inURL, isSet bool) error {
	if r.inURL != inURL {
		if !inURL {
			r.endURL()
		}
		r.inURL = inURL
	}
	if inURL {
		if isSet && bytes.ContainsRune(txt, ',') {
			r.query = false
		} else if r.query {
			if r.removeQuestionMark && txt[0] == '?' {
				txt = txt[1:]
			}
			if r.addAmpersand && len(txt) > 0 && txt[0] != '&' {
				_, err := io.WriteString(r.out, "&amp;")
				if err != nil {
					return err
				}
			}
			r.removeQuestionMark = false
			r.addAmpersand = false
		} else {
			r.query = bytes.ContainsAny(txt, "?#")
		}
		_, err := r.out.Write(txt)
		return err
	}
	_, err := r.out.Write(txt)
	return err
}
Text shows txt in the given context.
package runtime
import (
	"bytes"
	"errors"
	"fmt"
	"html"
	"io"
	"reflect"
	"sort"
	"strconv"
	"strings"
	"time"
	"unicode"
	"unicode/utf8"
	"github.com/open2b/scriggo/ast"
	"github.com/open2b/scriggo/native"
)
var byteSliceType = reflect.TypeOf([]byte(nil))
type renderer struct {
	env *env
	out io.Writer
	conv Converter
	inURL bool
	query bool
	addAmpersand bool
	removeQuestionMark bool
}
func newRenderer(env *env, out io.Writer, conv Converter) *renderer {
	return &renderer{env: env, out: out, conv: conv}
}
func (r *renderer) Close() error {
	if w, ok := r.out.(*markdownWriter); ok {
		return w.Close()
	}
	return nil
}
func (r *renderer) Show(v interface{}, context Context) error {
	ctx, inURL, _ := decodeRenderContext(context)
	if r.inURL != inURL {
		if !inURL {
			r.endURL()
		}
		r.inURL = inURL
	}
	if inURL {
		return r.showInURL(v, ctx)
	}
	var err error
	switch ctx {
	case ast.ContextText:
		err = showInText(r.env, r.out, v)
	case ast.ContextHTML:
		err = showInHTML(r.env, r.out, r.conv, v)
	case ast.ContextTag:
		err = showInTag(r.env, r.out, v)
	case ast.ContextQuotedAttr:
		err = showInAttribute(r.env, r.out, v, true)
	case ast.ContextUnquotedAttr:
		err = showInAttribute(r.env, r.out, v, false)
	case ast.ContextCSS:
		err = showInCSS(r.env, r.out, v)
	case ast.ContextCSSString:
		err = showInCSSString(r.env, r.out, v)
	case ast.ContextJS:
		err = showInJS(r.env, r.out, v)
	case ast.ContextJSString:
		err = showInJSString(r.env, r.out, v)
	case ast.ContextJSON:
		err = showInJSON(r.env, r.out, v)
	case ast.ContextJSONString:
		err = showInJSONString(r.env, r.out, v)
	case ast.ContextMarkdown:
		err = showInMarkdown(r.env, r.out, v)
	case ast.ContextTabCodeBlock:
		err = showInMarkdownCodeBlock(r.env, r.out, v, false)
	case ast.ContextSpacesCodeBlock:
		err = showInMarkdownCodeBlock(r.env, r.out, v, true)
	default:
		panic("scriggo: unknown context")
	}
	return err
}
func (r *renderer) Out() io.Writer {
	return r.out
}