Fix quotes' HTML rendering
authorLanius Trolling <lanius@laniustrolling.dev>
Thu, 8 Feb 2024 15:55:10 +0000 (10:55 -0500)
committerLanius Trolling <lanius@laniustrolling.dev>
Thu, 8 Feb 2024 15:55:10 +0000 (10:55 -0500)
src/jvmMain/kotlin/info/mechyrdia/lore/view_bar.kt
src/jvmMain/kotlin/info/mechyrdia/lore/views_quote.kt

index 2cc0c8c9bd4ab9c8c72e87a5ad16e0e4c414f0e1..06b0d151d4d52457ef91f6e71e9fc55d8593cba4 100644 (file)
@@ -32,12 +32,12 @@ data class NationProfileSidebar(val nationData: NationData) : Sidebar() {
        }
 }
 
-data class QuoteOriginSidebar(val author: String, val portrait: String, val link: String) : Sidebar() {
+data class QuoteOriginSidebar(val author: String, val fullPortrait: String, val fullLink: String) : Sidebar() {
        override fun TagConsumer<*>.display() {
-               img(src = "/assets/images/$portrait", alt = "Portrait of $author")
+               img(src = fullPortrait, alt = "Portrait of $author")
                p {
                        style = "text-align:center"
-                       a(href = "/lore/$link") {
+                       a(href = fullLink) {
                                +author
                        }
                }
index a38ede20a02f06856362e998d3fd4ea5a626f70f..f7baa6c75ad87eaa3b6774a9e70916a1581b33c0 100644 (file)
@@ -62,7 +62,7 @@ fun Quote.toJson(): String {
 
 context(ApplicationCall)
 suspend fun Quote.toHtml(title: String): HTML.() -> Unit {
-       return page(title, standardNavBar(), QuoteOriginSidebar(author, portrait, link)) {
+       return page(title, standardNavBar(), QuoteOriginSidebar(author, fullPortrait, fullLink)) {
                section {
                        a { id = "page-top" }
                        h1 { +title }
@@ -73,7 +73,7 @@ suspend fun Quote.toHtml(title: String): HTML.() -> Unit {
                                style = "align:right"
                                unsafe { raw("&#x2015;") }
                                +Entities.nbsp
-                               a(href = "/lore/$link") { +author }
+                               a(href = fullLink) { +author }
                        }
                }
        }