• Mike Samuel's avatar
    exp/template/html: Added handling for URL attributes. · 22d5f9aa
    Mike Samuel authored
    1. adds a urlPart field to context
    2. implements tURL to figure out the URL part
    3. modifies joinContext to allow common context mismatches
       around branches to be ignored when not material as in
       <a href="/foo{{if .HasQuery}}?q={{.Query}}{{/if}}">
    4. adds a pipeline function that filters dynamically inserted
       protocols to prevent code injection via URLs.
    
    R=nigeltao
    CC=golang-dev
    https://golang.org/cl/4957041
    22d5f9aa
context.go 3.92 KB