Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for escapeTemplate (0.2 sec)

  1. src/html/template/escape.go

    	"regexp"
    	"text/template"
    	"text/template/parse"
    )
    
    // escapeTemplate rewrites the named template, which must be
    // associated with t, to guarantee that the output of any of the named
    // templates is properly escaped. If no error is returned, then the named templates have
    // been modified. Otherwise the named templates have been rendered
    // unusable.
    func escapeTemplate(tmpl *Template, node parse.Node, name string) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 02 15:18:39 UTC 2023
    - 32.4K bytes
    - Viewed (0)
  2. src/html/template/template.go

    	defer t.nameSpace.mu.Unlock()
    	t.nameSpace.escaped = true
    	if t.escapeErr == nil {
    		if t.Tree == nil {
    			return fmt.Errorf("template: %q is an incomplete or empty template", t.Name())
    		}
    		if err := escapeTemplate(t, t.text.Root, t.Name()); err != nil {
    			return err
    		}
    	} else if t.escapeErr != escapeOK {
    		return t.escapeErr
    	}
    	return nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 21:00:46 UTC 2024
    - 17K bytes
    - Viewed (0)
  3. src/html/template/exec_test.go

    	if err != nil {
    		t.Error(err)
    	}
    	if b.String() != "result" {
    		t.Errorf("%s got %q, expected %q", textCall, b.String(), "result")
    	}
    }
    
    // Issue 39807. There was a race applying escapeTemplate.
    
    const raceText = `
    {{- define "jstempl" -}}
    var v = "v";
    {{- end -}}
    <script type="application/javascript">
    {{ template "jstempl" $ }}
    </script>
    `
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 24 21:59:12 UTC 2024
    - 57.6K bytes
    - Viewed (0)
Back to top