HandlerFeedGenerator: Use RevisionRenderer

This commit is contained in:
Albert S. 2022-08-20 10:26:14 +02:00
parent a1042720a7
commit 2b1c3c71b7

View File

@ -1,5 +1,6 @@
#include "handlerfeedgenerator.h" #include "handlerfeedgenerator.h"
#include "../parser.h" #include "../parser.h"
#include "../revisionrenderer.h"
std::vector<HandlerFeedGenerator::EntryRevisionPair> HandlerFeedGenerator::fetchEntries( std::vector<HandlerFeedGenerator::EntryRevisionPair> HandlerFeedGenerator::fetchEntries(
std::vector<std::string> categories) std::vector<std::string> categories)
{ {
@ -67,6 +68,8 @@ std::string HandlerFeedGenerator::generateAtom(const std::vector<HandlerFeedGene
subtitle = "All pages"; subtitle = "All pages";
} }
RevisionRenderer revisionRenderer { *this->templ, *this->database, *this->urlProvider };
for(const EntryRevisionPair &entry : entries) for(const EntryRevisionPair &entry : entries)
{ {
const Page &page = entry.first; const Page &page = entry.first;
@ -87,8 +90,7 @@ std::string HandlerFeedGenerator::generateAtom(const std::vector<HandlerFeedGene
atomentry.setVar("entryid", utils::html_xss(entryurl)); atomentry.setVar("entryid", utils::html_xss(entryurl));
atomentry.setVar("entrypublished", entryPublished); atomentry.setVar("entrypublished", entryPublished);
atomentry.setVar("entryupdated", entryUpdated); atomentry.setVar("entryupdated", entryUpdated);
Parser parser; atomentry.setVar("entrycontent", utils::html_xss(revisionRenderer.renderContent(current, page.title)));
atomentry.setVar("entrycontent", utils::html_xss(parser.parse(*pageDao, *this->urlProvider, current.content)));
stream << atomentry.render(); stream << atomentry.render();
} }
stream << atomfooter; stream << atomfooter;