From 706c793cc258983abb3d0ca1f29184daeaa1caa6 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Sun, 4 Jun 2017 16:38:01 +0100 Subject: [PATCH] Ensure we do not append the altLink to any images as it blows up if we do --- OurUmbraco.Site/Views/Lesson.cshtml | 3 ++- OurUmbraco/Documentation/Busineslogic/MarkdownLogic.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OurUmbraco.Site/Views/Lesson.cshtml b/OurUmbraco.Site/Views/Lesson.cshtml index 45c70b7a..19f21cab 100644 --- a/OurUmbraco.Site/Views/Lesson.cshtml +++ b/OurUmbraco.Site/Views/Lesson.cshtml @@ -4,7 +4,8 @@ Layout = null; var path = HttpContext.Current.Items[MarkdownLogic.MarkdownPathKey].ToString(); - var ml = new MarkdownLogic(path) { PrefixLinks = false, AppendAltLessonLink = false }; + var ml = new MarkdownLogic(path) { PrefixLinks = false, AppendAltLessonLink = true }; + var markdown = ml.DoTransformation(); } diff --git a/OurUmbraco/Documentation/Busineslogic/MarkdownLogic.cs b/OurUmbraco/Documentation/Busineslogic/MarkdownLogic.cs index 67485cb5..87606103 100644 --- a/OurUmbraco/Documentation/Busineslogic/MarkdownLogic.cs +++ b/OurUmbraco/Documentation/Busineslogic/MarkdownLogic.cs @@ -82,7 +82,8 @@ namespace OurUmbraco.Documentation.Busineslogic else mdUrlTag.TrimEnd('/'); - if (AppendAltLessonLink) + //Need to ensure we dont append the image links as they 404 if we add altTemplate + if (AppendAltLessonLink && rawUrl.StartsWith("images/") == false) { return mdUrlTag.Replace(rawUrl, $"{rawUrl.EnsureNoDotsInUrl()}?altTemplate=Lesson"); }