Skip to content

Commit

Permalink
Fix entry tags in atom
Browse files Browse the repository at this point in the history
Closes GH-2.
  • Loading branch information
lonr authored May 2, 2023
1 parent ea6548c commit 8e3fd17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/atom.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function atom(channel, data) {
if (datum.tags) {
let offset = -1
while (++offset < datum.tags.length) {
items.push(x('category', {term: String(datum.tags[offset])}))
children.push(x('category', {term: String(datum.tags[offset])}))
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"typescript": "^5.0.0",
"xast-util-to-xml": "^3.0.0",
"xo": "^0.53.0"
},
Expand Down
12 changes: 12 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,18 @@ test('atom', () => {
name: 'title',
attributes: {},
children: [{type: 'text', value: 'c'}]
},
{
type: 'element',
name: 'category',
attributes: {term: 'x'},
children: []
},
{
type: 'element',
name: 'category',
attributes: {term: 'y'},
children: []
}
]
},
Expand Down

0 comments on commit 8e3fd17

Please sign in to comment.