Skip to content

Commit

Permalink
Fix tag stringification example (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHaaversen authored Oct 24, 2023
1 parent 98f23ad commit 87f5cdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ If you need to stringify these you can use the following algo:
```js
const stringify = (title, metas, links) => {
const stringifyTag = (tagName, tags) =>
tags.reduce((acc, tag) => {
tags.reduce((acc, tag) =>
`${acc}<${tagName}${Object.keys(tag).reduce(
(properties, key) => `${properties} ${key}="${tag[key]}"`,
''
)}>`;
}, '');
)}>`
, '');

return `
<title>${title}</title>
Expand Down

0 comments on commit 87f5cdf

Please sign in to comment.