From 03dc3ceed922e6ab00faf21fa5ff8ff471453980 Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Sun, 28 Apr 2024 09:09:27 -0400 Subject: [PATCH] Fix builder lexer --- src/jvmMain/kotlin/info/mechyrdia/lore/ParserBuilder.kt | 6 +++--- src/jvmMain/kotlin/info/mechyrdia/lore/ViewOg.kt | 6 +++--- src/jvmMain/kotlin/info/mechyrdia/lore/ViewsRss.kt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jvmMain/kotlin/info/mechyrdia/lore/ParserBuilder.kt b/src/jvmMain/kotlin/info/mechyrdia/lore/ParserBuilder.kt index 34d4681..7cbe750 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/lore/ParserBuilder.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/lore/ParserBuilder.kt @@ -6,7 +6,7 @@ import info.mechyrdia.data.Id abstract class BuilderLexerProcessor : LexerTagFallback, LexerTextProcessor, LexerLineBreakProcessor, LexerCombiner { override fun processInvalidTag(env: LexerTagEnvironment, tag: String, param: String?, subNodes: ParserTree) { - // no-op + env.processTree(subNodes) } override fun processText(env: LexerTagEnvironment, text: String) { @@ -66,8 +66,8 @@ class TableOfContentsBuilder { fun toPageTitle() = title ?: MISSING_TITLE fun toOpenGraph() = description?.let { desc -> - image?.let { image -> - OpenGraphData(desc, image) + image?.let { img -> + OpenGraphData(desc, img) } } diff --git a/src/jvmMain/kotlin/info/mechyrdia/lore/ViewOg.kt b/src/jvmMain/kotlin/info/mechyrdia/lore/ViewOg.kt index 796ca73..c0efafa 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/lore/ViewOg.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/lore/ViewOg.kt @@ -9,7 +9,7 @@ import kotlinx.serialization.Serializable @Serializable data class OpenGraphData( - val desc: String, + val description: String, val image: String ) @@ -22,11 +22,11 @@ fun HEAD.ogProperty(property: String, content: 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("/")}") } diff --git a/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsRss.kt b/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsRss.kt index a0f77d8..1be6880 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsRss.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsRss.kt @@ -101,7 +101,7 @@ suspend fun generateRecentPageEdits(): RssChannel { 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", @@ -139,7 +139,7 @@ suspend fun ApplicationCall.recentCommentsRssFeedGenerator(limit: Int): RssChann 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) -- 2.25.1