Implement substr template function
authorAnthony Fok <foka@debian.org>
Mon, 23 Mar 2015 17:23:13 +0000 (11:23 -0600)
committerbep <bjorn.erik.pedersen@gmail.com>
Mon, 23 Mar 2015 17:56:58 +0000 (18:56 +0100)
commit5b0245ca59e22d90add28b11898ecfd602429e43
treef830c74f5c5e021ce470df4555ed5e5463871c53
parentbeb423a2d9683dfc07b2f69766e17c32589d489b
Implement substr template function

Its behavior is similar to that in JavaScript
with special handling of negative length as found in in PHP.

Fixes #991
tpl/template.go
tpl/template_test.go