Skip to content

Commit fa7e24a

Browse files
committed
Fixed warnings in release mode
Better handling of unloadable images
1 parent de3145a commit fa7e24a

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Display/XamlRenderer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ private void RenderImage(InlineCollection inlineCollection, ImageInline element,
908908
// if url is not absolute we have to return as local images are not supported
909909
if (!element.Url.StartsWith("http") && !element.Url.StartsWith("ms-app"))
910910
{
911+
RenderTextRun(inlineCollection, new TextRunInline { Text = element.Text, Type = MarkdownInlineType.TextRun }, context);
911912
return;
912913
}
913914

Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Parse/Inlines/ImageInline.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ internal static Common.InlineParseResult Parse(string markdown, int start, int e
122122
var result = new ImageInline
123123
{
124124
Tooltip = tooltip,
125-
Url = url
125+
Url = url,
126+
Text = markdown.Substring(start, pos + 1)
126127
};
127128
return new Common.InlineParseResult(result, start, end);
128129
}

Microsoft.Toolkit.Uwp.UI/Microsoft.Toolkit.Uwp.UI.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
<WarningLevel>4</WarningLevel>
4141
<RunCodeAnalysis>true</RunCodeAnalysis>
4242
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
43-
<DocumentationFile>bin\Release\Microsoft.Toolkit.Uwp.UI.xml</DocumentationFile>
43+
<DocumentationFile>
44+
</DocumentationFile>
4445
<CodeAnalysisRuleSet>microsoft.toolkit.uwp.ui.ruleset</CodeAnalysisRuleSet>
4546
</PropertyGroup>
4647
<ItemGroup>

Microsoft.Toolkit.Uwp.UI/Microsoft.Toolkit.Uwp.UI.ruleset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,6 @@
7575
<Rule Id="SA1201" Action="None" />
7676
<Rule Id="SA1309" Action="None" />
7777
<Rule Id="SA1634" Action="None" />
78+
<Rule Id="SA1652" Action="None" />
7879
</Rules>
7980
</RuleSet>

0 commit comments

Comments
 (0)