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 } diff --git a/print/print.go b/print/print.go index bc70da2..ccafec1 100644 --- a/print/print.go +++ b/print/print.go @@ -74,7 +74,7 @@ func Markdown(d *doc.Doc) (string, error) { buf.WriteString(fmt.Sprintf("| %s | %s | %s | %v |\n", v.Name, - v.Description, + strings.TrimSpace(v.Description), def, humanize(v.Default))) }