Commit graph

4 commits

Author SHA1 Message Date
bep 420c9e4d3d Add writable context to Node
The variable scope in the Go templates makes it hard, if possible at all, to write templates with counter variables or similar state.

This commit fixes that by adding a writable context to Node, backed by a map: Scratch.

This context has three methods, Get, Set and Add. The Add is tailored for counter variables, but can be used for any built-in numeric values or strings.
2015-01-31 22:01:30 +01:00
bep 9e688507a7 Add more tests to general helper 2015-01-20 18:13:47 +01:00
Marek Stanley 49f5eb5c84 Moved a test regarding a content.go function to a new test file content_test.go.
Added some tests for general helpers, especially as a way to document the expected behavior,
and as a warm-up welcome contribution.
2015-01-09 12:42:13 +01:00
Owen Waller 57cd953997 Added the general modules test files
Added the new general module's test file, general_test.go. This replaces the
helpers_test.go file.

There is also a minor defect fix in general.go's StripHTML function.
The correct xhtml tag for a break is <br /> not </br>. I've also removed
the unnecessary spaces before the replacement "\n".

The new test module also reflects this change.

Conflicts:
	helpers/general.go
2014-11-04 11:13:41 -05:00