Skip to content

MarkdownTextBlock throws an ArgumentException when using a markdown link with a superscript link as textΒ #2806

@Sergio0694

Description

@Sergio0694

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

Trying to render a markdown like this throws an ArgumentException:

[^(www.google.com)](www.google.com)

The crash happens at the last line, localContext.InlineCollection.Add(link);, from this method: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/a722f171cac7959d8fb39d732c5951018a2e8c07/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render/MarkdownRenderer.Inlines.cs#L188

This is probably related in some way to #2802

Expected behavior

The markdown should be correctly rendered as a superscript link.

Minimal reproduction of the problem with instructions

Write the following text in a MarkdownTextBlock control:

[^(www.google.com)](www.google.com)

Environment

Nuget Package(s): Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 5.0.0.0

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: )
- [ ] 2017 Preview (version: )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions