aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html
AgeCommit message (Collapse)Author
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
2014-08-29text/template: add back pointer to Nodes for better error generationRob Pike
ErrorContext now has all the information it needs from the Node, rather than depending on the template that contains it. This makes it easier for html/template to generate correct locations in its error messages. Updated html/template to use this ability where it is easy, which is not everywhere, but more work can probably push it through. Fixes #8577. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://golang.org/cl/130620043
2014-08-19html/template: don't panic on second execution of unescapable templateAndrew Gerrand
Fixes #8431. LGTM=r R=golang-codereviews, r, minux CC=golang-codereviews https://golang.org/cl/130830043
2014-05-19text/template,html/template: document that partial results may be written on ↵Rob Pike
error Fixes #7445. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/94640043
2014-05-01html: fix small typoRobert Hencke
LGTM=dsymonds, adg, crawshaw, r, bradfitz, campoy, nigeltao, sameer, iant, robsc, djd, michael.j.fromberger, gmlewis, adonovan, rsc R=golang-codereviews, dsymonds, adg, crawshaw, r, nigeltao, sameer, iant, robsc, djd, michael.j.fromberger, gmlewis, adonovan, rsc CC=golang-codereviews https://golang.org/cl/98880043
2014-04-26src: fix issues found by go vet stdRobert Hencke
LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/96850043
2014-04-15text/template: say more often that templates are safe for parallel executionRob Pike
It was said already but apparently not enough times. Fixes #6985. LGTM=crawshaw R=golang-codereviews, crawshaw CC=golang-codereviews https://golang.org/cl/86300043
2014-04-09html/template: fix two unrelated bugsRob Pike
1) The code to catch an exception marked the template as escaped when it was not yet, which caused subsequent executions of the template to not escape properly. 2) ensurePipelineContains needs to handled Field as well as Identifier nodes. Fixes #7379. LGTM=mikesamuel R=mikesamuel CC=golang-codereviews https://golang.org/cl/85240043
2014-04-01html/template: fix broken linksShenghou Ma
Fixes #7562. LGTM=nigeltao R=nigeltao CC=golang-codereviews https://golang.org/cl/81190044
2013-12-18html: add tests for UnescapeString edge casesShawn Smith
R=golang-dev, gobot, bradfitz CC=golang-dev https://golang.org/cl/40810044
2013-09-25html/template: update the Tree field after parsing new templatesRob Pike
After text/template.Parse, all the templates may have changed, so we need to set them all back to their unescaped state. The code did this but (mea culpa) forgot to set the Tree field of the html/template struct. Since the Tree is reset during escaping, this only matters if an error arises during escaping and we want to print a message. Fixes #6459. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/13877043
2013-09-17text/template/parse, html/template: copy Tree.text during html template cloneJosh Bleecher Snyder
The root cause of the panic reported in https://code.google.com/p/go/issues/detail?id=5980 is that parse's Tree.Text wasn't being copied during the clone. Fix this by adding and using a Copy method for parse.Tree. Fixes #5980. R=golang-dev, r CC=golang-dev https://golang.org/cl/12420044
2013-09-05html/template: export the parse.Tree for the escaped templateRob Pike
The underlying parse tree is visible in text/template, so it should be visible here. Done by copying the underlying *parse.Tree up to the top level of the struct, and then making sure it's kept up to date. Fixes #6318. R=mikesamuel CC=golang-dev https://golang.org/cl/13479044
2013-08-09encoding/json: escape & alwaysRuss Cox
There are a few different places in the code that escape possibly-problematic characters like < > and &. This one was the only one missing &, so add it. This means that if you Marshal a string, you get the same answer you do if you Marshal a string and pass it through the compactor. (Ironically, the compaction makes the string longer.) Because html/template invokes json.Marshal to prepare escaped strings for JavaScript, this changes the form of some of the escaped strings, but not their meaning. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12708044
2013-08-07all: fix up language in a couple of commentsRob Pike
Leftovers from 11699043 R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/12558046
2013-08-04html/template: delete panic recovery code from testRob Pike
The test isn't checking deliberate panics so catching them just makes the code longer. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12420043
2013-08-04html/template: handle nils during indirectionJosh Bleecher Snyder
Fixes #5982. R=golang-dev, r CC=golang-dev https://golang.org/cl/12387043
2013-08-03various: deleted unused itemsRob Pike
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12396043
2013-07-23all: be more idiomatic when documenting boolean return values.Rob Pike
Phrases like "returns whether or not the image is opaque" could be describing what the function does (it always returns, regardless of the opacity) or what it returns (a boolean indicating the opacity). Even when the "or not" is missing, the phrasing is bizarre. Go with "reports whether", which is still clunky but at least makes it clear we're talking about the return value. These were edited by hand. A few were cleaned up in other ways. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/11699043
2013-07-10html: add escaping testsAndrew Gerrand
R=golang-dev, dsymonds, bradfitz CC=golang-dev https://golang.org/cl/11095043
2013-03-22build: remove dead codeRuss Cox
R=golang-dev, r CC=golang-dev https://golang.org/cl/7877045
2013-03-12html/template: Ensure release of namespace mutex in Template.Execute()Robert Figueiredo
R=golang-dev, r CC=golang-dev https://golang.org/cl/6727046
2013-03-11all: remove now-unnecessary unreachable panicsBrad Fitzpatrick
Take advantage of the new terminating statement rule. R=golang-dev, r, gri CC=golang-dev https://golang.org/cl/7712044
2013-03-01html/template: fix doc typoAndrew Gerrand
Fixes #4950. R=golang-dev, peter CC=golang-dev https://golang.org/cl/7415046
2013-01-18html/template: remove noescape supportAndrew Gerrand
This was never documented or properly implemented. Fixes #3528. R=mikesamuel, rsc CC=golang-dev https://golang.org/cl/7142048
2013-01-14html/template: Clarifying references to "text/template" in the documentation.Francesc Campoy
Fixes #4634. R=adg, kevlar CC=golang-dev https://golang.org/cl/7066053
2012-11-22all: fix the the typosShenghou Ma
Fixes #4420. R=golang-dev, rsc, remyoudompheng CC=golang-dev https://golang.org/cl/6854080
2012-10-30gofmt: apply gofmt -w src miscRobert Griesemer
Remove trailing whitespace in comments. No other changes. R=r CC=golang-dev https://golang.org/cl/6815053
2012-10-09gofmt: apply gofmt -w -s src miscRobert Griesemer
Preparation for forthcoming CL 6624051: Will make it easier to see if/what changes are incurred by it. The alignment changes in this CL are due to CL 6610051 (fix to alignment heuristic) where it appears that an old version of gofmt was run (and thus the correct alignment updates were not done). R=r CC=golang-dev https://golang.org/cl/6639044
2012-10-03text/template: better error messages during execution,Rob Pike
They now show the correct name, the byte offset on the line, and context for the failed evaluation. Before: template: three:7: error calling index: index out of range: 5 After: template: top:7:20: executing "three" at <index "hi" $>: error calling index: index out of range: 5 Here top is the template that was parsed to create the set, and the error appears with the action starting at byte 20 of line 7 of "top", inside the template called "three", evaluating the expression <index "hi" $>. Also fix a bug in index: it didn't work on strings. Ouch. Also fix bug in error for index: was showing type of index not slice. The real previous error was: template: three:7: error calling index: can't index item of type int The html/template package's errors can be improved by building on this; I'll do that in a separate pass. Extends the API for text/template/parse but only by addition of a field and method. The old API still works. Fixes #3188. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/6576058
2012-09-24text/template: allow .Field access to parenthesized expressionsRob Pike
Change the grammar so that field access is a proper operator. This introduces a new node, ChainNode, into the public (but actually internal) API of text/template/parse. For compatibility, we only use the new node type for the specific construct, which was not parseable before. Therefore this should be backward-compatible. Before, .X.Y was a token in the lexer; this CL breaks it out into .Y applied to .X. But for compatibility we mush them back together before delivering. One day we might remove that hack; it's the simple TODO in parse.go/operand. This change also provides grammatical distinction between f and (f) which might permit function values later, but not now. Fixes #3999. R=golang-dev, dsymonds, gri, rsc, mikesamuel CC=golang-dev https://golang.org/cl/6494119
2012-09-13html/template: fix URL docRuss Cox
This is the easy part of issue 3528. (What to do about "noescape" is the hard part, left open.) Update #3528. R=mikesamuel, r, dsymonds CC=golang-dev https://golang.org/cl/6493113
2012-07-09pkg: Removing duplicated words ("of of", etc.), mostly from comments.David G. Andersen
Ran 'double.pl' on the pkg tree to identify doubled words. One change to an error string return in x509; the rest are in comments. Thanks to Matt Jibson for the idea. R=golang-dev, bsiegert CC=golang-dev https://golang.org/cl/6344089
2012-04-12html, exp/html: escape ' and " as &#39; and &#34;, since IE8 andNigel Tao
below do not support &apos;. This makes package html consistent with package text/template's HTMLEscape function. Fixes #3489. R=rsc, mikesamuel, dsymonds CC=golang-dev https://golang.org/cl/5992071
2012-03-21html/template: fix typo and make grammar consistent in comments.David Symonds
R=golang-dev, r CC=golang-dev https://golang.org/cl/5866044
2012-03-20html/template: add Templates and *Escape functionsRob Pike
to bring it in line with text/template's interface. Fixes #3296. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5843066
2012-03-14html/template: fix nil pointer bugRob Pike
Fixes #3272. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5819046
2012-03-13html/template: fix panic on CloneBrad Fitzpatrick
Fixes #3281 R=golang-dev, r CC=golang-dev https://golang.org/cl/5819044
2012-03-12html/template: doc nitRuss Cox
Execute's data is untrusted regardless of package. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5797062
2012-03-05html/template: fix comment typoScott Lawrence
R=golang-dev, r CC=golang-dev https://golang.org/cl/5730051
2012-03-01html/template: encoding/json does more escaping now, so update the ↵David Symonds
html/template test that uses it. R=golang-dev, r CC=golang-dev https://golang.org/cl/5714052
2012-02-27html/template: use correct method signature, in introduction example.Mike Rosset
R=golang-dev, nigeltao CC=golang-dev https://golang.org/cl/5695067
2012-02-24html/template: make doctype check case-insensitiveScott Lawrence
Fixes #3094. R=golang-dev, rsc, nigeltao CC=golang-dev https://golang.org/cl/5687065
2012-02-20html/template: don't indirect past a StringerRob Pike
While we're here, get rid of the old names for the escaping functions. Fixes #3073. R=golang-dev, dsymonds, rsc CC=golang-dev https://golang.org/cl/5685049
2012-02-20html/template: minor tweak to docs to improve HTML typography.David Symonds
R=golang-dev, r CC=golang-dev https://golang.org/cl/5684046
2012-02-18html/template: replace obsolete reference to template.SetRob Pike
Fixes #3053. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5656094
2012-02-16html/template: clone is implemented elsewhere, so delete this implementationRob Pike
R=golang-dev, nigeltao CC=golang-dev https://golang.org/cl/5676064
2012-02-15html/template: add Clone and AddParseTree. Make text/template's CloneNigel Tao
return (*Template, error), not just *Template. Fixes #2757. R=r CC=golang-dev https://golang.org/cl/5665044
2012-02-12html/template: Added more explicit wording about examples and documentation.Bjorn Tipling
R=golang-dev, r, r CC=golang-dev https://golang.org/cl/5654062
2012-02-06all: avoid bytes.NewBuffer(nil)Rob Pike
The practice encourages people to think this is the way to create a bytes.Buffer when new(bytes.Buffer) or just var buf bytes.Buffer work fine. (html/token.go was missing the point altogether.) R=golang-dev, bradfitz, r CC=golang-dev https://golang.org/cl/5637043