From 79a66d4fda6842b1a468927c6ac6579208cb252f Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Sun, 5 Nov 2023 10:11:04 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Prevent=20whitespace=20at=20star?= =?UTF-8?q?t=20of=20`render-link`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #695 --- CHANGELOG.md | 4 ++++ layouts/_default/_markup/render-link.html | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc04d41c..05e6d801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- Links with non-whitespace characters preceeding them are prefixed with a space ([#695](https://github.com/jpanther/congo/issues/695)) + ## [2.7.3] - 2023-10-31 ### Fixed diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index d0d013ae..e8799b1a 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,5 +1,5 @@ -{{ $link := .Destination }} -{{ $isRemote := strings.HasPrefix $link "http" }} +{{- $link := .Destination -}} +{{- $isRemote := strings.HasPrefix $link "http" -}} {{- if not $isRemote }} {{ $url := urls.Parse .Destination }} {{ if $url.Path }}