From 2cfb09e9a3aa720b902535a5bdf3641bcd8a903f Mon Sep 17 00:00:00 2001 From: Melroy van den Berg Date: Thu, 24 Oct 2024 00:56:04 +0200 Subject: [PATCH] theme(fix): add transform.Plainify to the summary body content of the share links (#758) You definitely want to **add Plainify transformer first**, because the body content will become a HTML encoding mess. I left `HTMLEscape` there as well, just be sure for security reasons. But if you want, I can remove the second transformer. Like a tweet on X will look like this: ![image](https://github.com/user-attachments/assets/73ab37b0-decc-47a4-8bbd-cf43cbef1641) After implementing `transform.Plainify`, it will look much better: ![image](https://github.com/user-attachments/assets/962ba515-72ae-4b46-827f-2c477358d065) (ignore the red, I don't have X premium pro blabla, it's red because I hit the max limit of chars) Signed-off-by: Melroy van den Berg --- layouts/partials/social/share.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/social/share.html b/layouts/partials/social/share.html index cb56e12be..14cdafc14 100644 --- a/layouts/partials/social/share.html +++ b/layouts/partials/social/share.html @@ -66,7 +66,7 @@ {{- $setup := .setup -}} {{- $separator := "&" -}} {{- $title := $context.Title | transform.HTMLEscape -}} - {{- $description := $context.Summary | transform.HTMLEscape -}} + {{- $description := $context.Summary | transform.Plainify | transform.HTMLEscape -}} {{- $permalink := $context.Permalink | transform.HTMLEscape -}} {{- with $setup.separator -}} {{- $separator = . -}}