Fix page descriptions having formatting tags
authorLanius Trolling <lanius@laniustrolling.dev>
Thu, 7 Mar 2024 17:41:00 +0000 (12:41 -0500)
committerLanius Trolling <lanius@laniustrolling.dev>
Thu, 7 Mar 2024 17:41:00 +0000 (12:41 -0500)
src/jvmMain/kotlin/info/mechyrdia/lore/parser_tags.kt

index 4f1598759642d3290fd180765cec33f95646b3a4..280c013b7f9d7f318c835a2949e3dc79cf61162f 100644 (file)
@@ -549,6 +549,6 @@ fun headerContentToLabel(content: String) = TextParserState.uncensorText(content
 fun headerContentToAnchor(content: String) = headerContentToLabel(content).replace(NON_ANCHOR_CHAR, "-")
 
 fun imagePathToOpenGraphValue(path: String) = "https://mechyrdia.info/assets/images/${sanitizeLink(path)}"
-fun descriptionContentToPlainText(content: String) = TextParserState.uncensorText(content)
+fun descriptionContentToPlainText(content: String) = TextParserState.uncensorText(content.replace(INSIDE_TAG_TEXT, ""))
 
 fun commentToPlainText(contentRaw: String) = TextParserState.uncensorText(TextParserState.parseText(contentRaw, TextParserCommentTagsPlainText.asTags, Unit).replace("<p>", "").replace("</p>", "").replace("<br/>", ""))