Fix builder lexer
authorLanius Trolling <lanius@laniustrolling.dev>
Sun, 28 Apr 2024 13:09:27 +0000 (09:09 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Sun, 28 Apr 2024 13:09:27 +0000 (09:09 -0400)
src/jvmMain/kotlin/info/mechyrdia/lore/ParserBuilder.kt
src/jvmMain/kotlin/info/mechyrdia/lore/ViewOg.kt
src/jvmMain/kotlin/info/mechyrdia/lore/ViewsRss.kt

index 34d468126bb57add6fc9c3bf34740224b5620bdd..7cbe750da906a373fd9af0a3e60e6eb1f941e06c 100644 (file)
@@ -6,7 +6,7 @@ import info.mechyrdia.data.Id
 
 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) {
@@ -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)
                }
        }
        
index 796ca73f9962da06dd9aa0f54a0384ea520cb623..c0efafa222a686f6ca36a880f1ba11d7ced72c00 100644 (file)
@@ -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("/")}")
 }
index a0f77d8791ccc93233a60658c6d94d0be1b91ded..1be68806d9b9484d35fa5a268d4be9ebbffd92c8 100644 (file)
@@ -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)