Windowscommunitytoolkit: Missing support for relative reference link and svg image in MarkdownTextBlock

Created on 6 Nov 2017  ·  4Comments  ·  Source: windows-toolkit/WindowsCommunityToolkit

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request <!-- Please file a UserVoice request and include the link below https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/193402-uwp-community-toolkit -->
[ ] Sample app request
[ ] Documentation issue or request
[ ] Question of Support request => Please do not submit support request here, instead see https://github.com/Microsoft/UWPCommunityToolkit/blob/master/contributing.md#question

UserVoice link

Current behavior

  1. Missing support for relative reference within same reference group. Its not generate the hyperlink link.
    Eg : [Refer relative reference](../home/relative.md)
  1. SVG images are not loaded in Image
    Eg : ![Toolkit logo](https://image.flaticon.com/icons/svg/178/178156.svg)

md-issue

Expected behavior

Minimal reproduction of the problem with instructions

Environment

Nuget Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

App min and target version:
- [ ] Anniversary Update (14393) 
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)

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

Visual Studio 
- [ ] 2017 15.3
- [x] 2017 15.4

controls help wanted improvements

Most helpful comment

@ilinkmobility For .svg image you can use SvgImageSource in ImageResolving event handler.

E.g.

private void MarkdownTextblock_ImageResolving(object sender, ImageResolvingEventArgs e)
{
    if (e.Url.EndsWith(".svg"))
    {
        e.Image = new SvgImageSource(new Uri(e.Url));
        e.Handled = true;
    }
}

All 4 comments

Thanks for submitting the issue, these both sound like great improvements. Feel free to submit a Pull Request to add these.

@ilinkmobility For .svg image you can use SvgImageSource in ImageResolving event handler.

E.g.

private void MarkdownTextblock_ImageResolving(object sender, ImageResolvingEventArgs e)
{
    if (e.Url.EndsWith(".svg"))
    {
        e.Image = new SvgImageSource(new Uri(e.Url));
        e.Handled = true;
    }
}

@krt, thank you.
I have tried that, its working with Creator update (v10.0.15063.0) and above. I hope for now MD tags are not supporting to specify image dimensions. The problem with SVG is its occupy entire screen. It would be better if it support to add dimension along with image links.

@ilinkmobility It will be supported when https://github.com/Microsoft/UWPCommunityToolkit/pull/1634 is merged

Was this page helpful?
0 / 5 - 0 ratings