<a href="javascript:doSlide%28%27%7b%7barea%7d%7d%27%29;">{{test}}</a>
<a href="javascript:doSlide('{{area}}');">{{test}}</a>
package main
import ( "html/template" "os")
var t = template.Must(template.New("test").Funcs(template.FuncMap{ "safeattr": func(value string) template.HTMLAttr { return template.HTMLAttr(value) }, "safehtml": func(value string) template.HTML { return template.HTML(value) }, "safejs": func(value string) template.JS { return template.JS(value) }, "safecss": func(value string) template.CSS { return template.CSS(value) }, "safeurl": func(value string) template.URL { return template.URL(value) },}).Parse(`<a href="{{safeurl .href}}">{{safehtml .content}}</a>`))
func main() { data := map[string]string{ "href": "javascript:doSlide('{{area}}');", "content": "{{test}}", } err := t.Execute(os.Stdout, data) if err != nil { panic(err) }}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0c93e49c-1e8b-4617-baef-0848b57fde93%40googlegroups.com.
<a href="#ZgotmplZ">{{test}}</a>
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0c93e49c-1e8b-4617-baef-0848b57fde93%40googlegroups.com.