https://github.com/alecthomas/template
Fork of Go's text/template adding newline elision
https://github.com/alecthomas/template
Last synced: over 1 year ago
JSON representation
Fork of Go's text/template adding newline elision
- Host: GitHub
- URL: https://github.com/alecthomas/template
- Owner: alecthomas
- License: bsd-3-clause
- Created: 2015-02-19T06:03:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-02T07:09:29.000Z (over 2 years ago)
- Last Synced: 2024-10-29T19:58:27.960Z (over 1 year ago)
- Language: Go
- Size: 80.1 KB
- Stars: 56
- Watchers: 7
- Forks: 27
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go's `text/template` package with newline elision
This is a fork of Go 1.4's [text/template](http://golang.org/pkg/text/template/) package with one addition: a backslash immediately after a closing delimiter will delete all subsequent newlines until a non-newline.
eg.
```
{{if true}}\
hello
{{end}}\
```
Will result in:
```
hello\n
```
Rather than:
```
\n
hello\n
\n
```