2022-08-02 12:34:52 +00:00
|
|
|
import { contentToBlocks, parseMediaAndBanner } from '../util.mjs'
|
2022-07-27 08:41:18 +00:00
|
|
|
|
2022-07-26 02:55:37 +00:00
|
|
|
export function parseArticles(articles) {
|
|
|
|
for (let i = 0; i < articles.length; i++) {
|
|
|
|
parseArticle(articles[i])
|
|
|
|
}
|
|
|
|
return articles
|
|
|
|
}
|
|
|
|
|
|
|
|
export function parseArticle(article) {
|
|
|
|
if (!article) {
|
|
|
|
return null
|
|
|
|
}
|
2022-08-02 12:34:52 +00:00
|
|
|
article.content = contentToBlocks(article.content)
|
|
|
|
parseMediaAndBanner(article)
|
2022-07-26 02:55:37 +00:00
|
|
|
return article
|
|
|
|
}
|