Process post content as markdown

This commit is contained in:
Christoph Hagen
2025-02-03 12:14:07 +01:00
parent a29e6229c1
commit d41c54d174
8 changed files with 194 additions and 46 deletions

View File

@ -35,9 +35,7 @@ struct FeedEntry: HtmlProducer {
TagList(tags: data.tags).populate(&result)
ContentLabels(labels: data.labels).populate(&result)
for paragraph in data.text {
result += "<p>\(paragraph)</p>"
}
result += data.text
if let url = data.link {
result += "<div class='link-center'><div class='link'>\(url.text)</div></div>"
}

View File

@ -13,11 +13,11 @@ struct FeedEntryData {
let labels: [ContentLabel]
let text: [String]
let text: String
let media: Media?
init(entryId: String, title: String?, textAboveTitle: String, link: Link?, tags: [Tag], labels: [ContentLabel], text: [String], media: Media?) {
init(entryId: String, title: String?, textAboveTitle: String, link: Link?, tags: [Tag], labels: [ContentLabel], text: String, media: Media?) {
self.entryId = entryId
self.title = title
self.textAboveTitle = textAboveTitle