From 47ba53928f8d7771578917b59405bcfe07d70104 Mon Sep 17 00:00:00 2001 From: Joshua Bussdieker Date: Tue, 9 Aug 2016 17:08:56 -0700 Subject: [PATCH] Fix HEREDOC descriptions --- doc/doc.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/doc.go b/doc/doc.go index 33e60be..a246fed 100644 --- a/doc/doc.go +++ b/doc/doc.go @@ -77,7 +77,7 @@ func inputs(list *ast.ObjectList) []Input { if is(item, "variable") { name, _ := strconv.Unquote(item.Keys[1].Token.Text) items := item.Val.(*ast.ObjectType).List.Items - desc, _ := strconv.Unquote(description(items)) + desc := description(items) def := get(items, "default") ret = append(ret, Input{ Name: name, @@ -120,7 +120,11 @@ func get(items []*ast.ObjectItem, key string) *Value { v := new(Value) if lit, ok := item.Val.(*ast.LiteralType); ok { - v.Literal = lit.Token.Text + if value, ok := lit.Token.Value().(string); ok { + v.Literal = value + } else { + v.Literal = lit.Token.Text + } v.Type = "string" return v }