Skip to content

Commit

Permalink
Merge pull request #144 from craveytrain/fix-android-xml-format-value
Browse files Browse the repository at this point in the history
Moves value from from attribute
  • Loading branch information
aputinski authored Jun 4, 2018
2 parents 55b8ca3 + 79a8c34 commit 9b9306a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
10 changes: 5 additions & 5 deletions lib/__tests__/__snapshots__/formats.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
exports[`android.xml 1`] = `
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>
<resources>
<property name=\\"TOKEN_COLOR\\" category=\\"background-color\\" value=\\"#bada55\\"/>
<property name=\\"TOKEN_SIZE\\" category=\\"spacing\\" value=\\"20px\\"/>
<property name=\\"TOKEN_STRING\\" category=\\"test\\" value=\\"/assets/images\\"/>
<property name=\\"TOKEN_NUMBER\\" category=\\"test\\" value=\\"2\\"/>
<property name=\\"TOKEN_QUOTES\\" category=\\"test\\" value=\\"&apos;Salesforce Sans&apos;, &quot;Helvetica Neue&quot;, sans-serif\\"/>
<property name=\\"TOKEN_COLOR\\" category=\\"background-color\\">#bada55</property>
<property name=\\"TOKEN_SIZE\\" category=\\"spacing\\">20px</property>
<property name=\\"TOKEN_STRING\\" category=\\"test\\">/assets/images</property>
<property name=\\"TOKEN_NUMBER\\" category=\\"test\\">2</property>
<property name=\\"TOKEN_QUOTES\\" category=\\"test\\">&apos;Salesforce Sans&apos;, &quot;Helvetica Neue&quot;, sans-serif</property>
</resources>"
`;
Expand Down
18 changes: 11 additions & 7 deletions lib/formats/android.xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ module.exports = def => {
return "property";
}
})();

return {
[key]: {
_attr: {
name: _.toUpper(prop.get("name")),
category: prop.get("category"),
value: prop.get("value")
}
}
[key]: [
{
_attr: {
name: _.toUpper(prop.get("name")),
category: prop.get("category")
}
},
prop.get("value")
]
};
})
.toJS()
};

return xml(o, { indent: " ", declaration: true });
};

0 comments on commit 9b9306a

Please sign in to comment.