abstract class BuilderLexerProcessor<TContext> : LexerTagFallback<TContext, Unit>, LexerTextProcessor<TContext, Unit>, LexerLineBreakProcessor<TContext, Unit>, LexerCombiner<TContext, Unit> {
override fun processInvalidTag(env: LexerTagEnvironment<TContext, Unit>, tag: String, param: String?, subNodes: ParserTree) {
- // no-op
+ env.processTree(subNodes)
}
override fun processText(env: LexerTagEnvironment<TContext, Unit>, text: String) {
fun toPageTitle() = title ?: MISSING_TITLE
fun toOpenGraph() = description?.let { desc ->
- image?.let { image ->
- OpenGraphData(desc, image)
+ image?.let { img ->
+ OpenGraphData(desc, img)
}
}
@Serializable
data class OpenGraphData(
- val desc: String,
+ val description: String,
val image: String
)
context(ApplicationCall)
fun HEAD.renderOgData(title: String, data: OpenGraphData) {
- meta(name = "description", content = data.desc)
+ meta(name = "description", content = data.description)
ogProperty("title", title)
ogProperty("type", "website")
- ogProperty("description", data.desc)
+ ogProperty("description", data.description)
ogProperty("image", data.image)
ogProperty("url", "$MainDomainName/${request.path().removePrefix("/")}")
}
RssItem(
title = pageToC.toPageTitle(),
- description = pageOg?.desc,
+ description = pageOg?.description,
link = "$MainDomainName/lore${pageLink.joinToString(separator = "") { "/$it" }}",
author = null,
comments = "$MainDomainName/lore${pageLink.joinToString(separator = "") { "/$it" }}#comments",
if (currNation?.id == OwnerNationId)
flow
else flow.filterNot { comment ->
- comment.submittedBy != currNation?.id && NationData.get(comment.submittedBy).isBanned
+ comment.submittedBy != currNation?.id && nationCache.getNation(comment.submittedBy).isBanned
}
}
.take(limit)