HandlerPageView: Parse dynamically included pages recursively
This commit is contained in:
parent
ba06d04a08
commit
03c5646858
@ -6,9 +6,7 @@ std::string DynamicContentIncludePage::render()
|
|||||||
auto rev = revisionDao->getCurrentForPage(this->argument);
|
auto rev = revisionDao->getCurrentForPage(this->argument);
|
||||||
if(rev)
|
if(rev)
|
||||||
{
|
{
|
||||||
Parser parser;
|
return rev->content;
|
||||||
auto result = parser.parse(*this->database->createPageDao(), *this->urlProvider, rev->content);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -137,6 +137,8 @@ Response HandlerPageView::handleRequest(PageDao &pageDao, std::string pagename,
|
|||||||
std::string indexcontent;
|
std::string indexcontent;
|
||||||
std::string parsedcontent;
|
std::string parsedcontent;
|
||||||
|
|
||||||
|
bool keepParsing = true;
|
||||||
|
|
||||||
std::function<std::string(std::string_view, std::string_view)> dynamicParseCallback =
|
std::function<std::string(std::string_view, std::string_view)> dynamicParseCallback =
|
||||||
[&](std::string_view key, std::string_view value) -> std::string
|
[&](std::string_view key, std::string_view value) -> std::string
|
||||||
{
|
{
|
||||||
@ -150,7 +152,7 @@ Response HandlerPageView::handleRequest(PageDao &pageDao, std::string pagename,
|
|||||||
{
|
{
|
||||||
std::shared_ptr<DynamicContentIncludePage> includePage = createDynamic<DynamicContentIncludePage>();
|
std::shared_ptr<DynamicContentIncludePage> includePage = createDynamic<DynamicContentIncludePage>();
|
||||||
includePage->setArgument(std::string(value));
|
includePage->setArgument(std::string(value));
|
||||||
return includePage->render();
|
return parser.parse(pageDao, *this->urlProvider, includePage->render(), dynamicParseCallback);
|
||||||
}
|
}
|
||||||
return std::string{};
|
return std::string{};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user