Ensure we do not append the altLink to any images as it blows up if we do

This commit is contained in:
Warren Buckley
2017-06-04 16:38:01 +01:00
parent 492a3e5a8d
commit 706c793cc2
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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();
}
@@ -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");
}