From f67c3a88c03b650986d70b561800d3033f1a6c80 Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Thu, 24 Aug 2023 14:59:38 -0400 Subject: [PATCH] Fix image tags in commenting --- src/main/kotlin/info/mechyrdia/data/views_comment.kt | 8 ++++---- src/main/kotlin/info/mechyrdia/lore/parser_tags.kt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/info/mechyrdia/data/views_comment.kt b/src/main/kotlin/info/mechyrdia/data/views_comment.kt index ed64c34..14af059 100644 --- a/src/main/kotlin/info/mechyrdia/data/views_comment.kt +++ b/src/main/kotlin/info/mechyrdia/data/views_comment.kt @@ -465,8 +465,8 @@ suspend fun ApplicationCall.commentHelpPage(): HTML.() -> Unit = page("Commentin p { +"Creates an embedded image:" br - unsafe { - raw("") + img(src = "https://i.ibb.co/Lns12z1/robert-sparr.png") { + style = getImageSizeStyleValue(256, 256) } br +"The tag param controls the width and height, much like a table cell. The size unit is viewport-responsive and has no correlation with pixels." @@ -474,8 +474,8 @@ suspend fun ApplicationCall.commentHelpPage(): HTML.() -> Unit = page("Commentin p { +"A similar tag is used to embed images that are hosted on Imgur, e.g. the image at https://i.imgur.com/dd0mmQ1.png" br - unsafe { - raw("") + img(src = "https://i.imgur.com/dd0mmQ1.png") { + style = getImageSizeStyleValue(250, 323) } br +"can be embedded using [imgur=250x323]dd0mmQ1.png[/imgur]" diff --git a/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt b/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt index 70bd963..7c37e5d 100644 --- a/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt +++ b/src/main/kotlin/info/mechyrdia/lore/parser_tags.kt @@ -361,7 +361,7 @@ enum class TextParserCommentTags(val type: TextParserTagType) { val imageUrl = sanitizeExtLink(content) val (width, height) = getSizeParam(tagParam) - "" + "" } ), IMGBB( @@ -369,7 +369,7 @@ enum class TextParserCommentTags(val type: TextParserTagType) { val imageUrl = sanitizeExtLink(content) val (width, height) = getSizeParam(tagParam) - "" + "" } ), -- 2.25.1