From 726a25bed7de11cc3852a750f7be40fd34c95bcd Mon Sep 17 00:00:00 2001 From: kageru Date: Wed, 27 May 2020 14:27:31 +0200 Subject: [PATCH] Fix indentation in meta content tag Most preview applications render this as html, which will strip repeated spaces. By instead emitting  , we can retain the indentation. Groups of two spaces are replaced with two nbsp because single spaces (i.e. gaps between words) should still be breaking. --- src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt b/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt index abeed14..f8c92d7 100644 --- a/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt +++ b/src/main/kotlin/moe/kageru/kodeshare/pages/PastePage.kt @@ -14,7 +14,7 @@ object PastePage { ) script(src = "/static/hl.js") {} // Show the first 3 lines in preview/embed for applications like discord, slack, or skype - meta(content = content.lines().take(3).joinToString("\n")) { + meta(content = content.lines().take(3).joinToString("\n").replace(" ", "  ")) { attributes["property"] = "og:description" } unsafe {