From 3ea0d8d8ec5813f4a0aaffda145b32c08117adbe Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 29 May 2019 18:33:54 -0700 Subject: [PATCH] fix for issue #45 --- CHANGELOG.md | 1 + yaml/pretty/util.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9354f6..f9474cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Fixed - Support for yaml merge keys, by [@bradrydzewski](https://github.com/bradrydzewski). +- Escape values with colons, by [@bradrydzewski](https://github.com/bradrydzewski). Issue [#45](https://github.com/drone/drone-yaml/issues/45). ## [1.0.9] - 2019-05-20 ### Added diff --git a/yaml/pretty/util.go b/yaml/pretty/util.go index 21b9ce7..75834d7 100644 --- a/yaml/pretty/util.go +++ b/yaml/pretty/util.go @@ -65,7 +65,7 @@ func isZero(v interface{}) bool { func isQuoted(b rune) bool { switch b { - case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': + case ':', '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': return true case '\a', '\b', '\f', '\n', '\r', '\t', '\v': return true