|
@@ -14,7 +14,7 @@ func MarshalODML(buf []byte) []byte {
|
|
od := Odml{}
|
|
od := Odml{}
|
|
decoder := xml.NewDecoder(bytes.NewReader(buf))
|
|
decoder := xml.NewDecoder(bytes.NewReader(buf))
|
|
decoder.CharsetReader = charset.NewReaderLabel
|
|
decoder.CharsetReader = charset.NewReaderLabel
|
|
- decoder.Decode(&od)
|
|
|
|
|
|
+ _ = decoder.Decode(&od)
|
|
data, _ := json.Marshal(od)
|
|
data, _ := json.Marshal(od)
|
|
return data
|
|
return data
|
|
}
|
|
}
|
|
@@ -57,7 +57,7 @@ func (u *Property) MarshalJSON() ([]byte, error) {
|
|
func (u *Section) MarshalJSON() ([]byte, error) {
|
|
func (u *Section) MarshalJSON() ([]byte, error) {
|
|
type Alias Section
|
|
type Alias Section
|
|
if u.Text == "" {
|
|
if u.Text == "" {
|
|
- u.Text = fmt.Sprintf("%s", u.Name)
|
|
|
|
|
|
+ u.Text = u.Name
|
|
}
|
|
}
|
|
for _, x := range u.Properties {
|
|
for _, x := range u.Properties {
|
|
u.Children = append(u.Children, OdMLObject{Prop: x, Type: "property"})
|
|
u.Children = append(u.Children, OdMLObject{Prop: x, Type: "property"})
|