Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Conversation

@davidholsgrove
Copy link
Contributor

Update example Documents directory to contain a local image (BenchmarkCPU) and have Markdig-readme.md use a relative link to the image file.

Prevents exception being thrown when using relative link;

Exception thrown: 'System.UriFormatException' in System.dll
An unhandled exception of type 'System.UriFormatException' occurred in System.dll
Invalid URI: The format of the URI could not be determined.

Unhandled Exception: System.UriFormatException: Invalid URI: The format of the URI could not be determined.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at Markdig.Renderers.Wpf.Inlines.LinkInlineRenderer.Write(WpfRenderer renderer, LinkInline link) in markdig.wpf\src\Markdig.Wpf\Renderers\Wpf\Inlines\LinkInlineRenderer.cs:line
34
at Markdig.Renderers.MarkdownObjectRenderer`2.Write(RendererBase renderer, MarkdownObject obj)
at Markdig.Renderers.RendererBase.Write[T](T obj)
at Markdig.Renderers.RendererBase.WriteChildren(ContainerInline containerInline)
at Markdig.Renderers.RendererBase.Write[T](T obj)
at Markdig.Renderers.WpfRenderer.WriteLeafInline(LeafBlock leafBlock) in markdig.wpf\src\Markdig.Wpf\Renderers\WpfRenderer.cs:line 82

Update example Documents directory to contain a local image (BenchmarkCPU) and have Markdig-readme.md use a relative link to the image file.

Prevents exception being thrown when using relative link;

> Exception thrown: 'System.UriFormatException' in System.dll
> An unhandled exception of type 'System.UriFormatException' occurred in System.dll
> Invalid URI: The format of the URI could not be determined.

> Unhandled Exception: System.UriFormatException: Invalid URI: The format of the URI could not be determined.
>    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
>    at System.Uri..ctor(String uriString)
>    at Markdig.Renderers.Wpf.Inlines.LinkInlineRenderer.Write(WpfRenderer renderer, LinkInline link) in markdig.wpf\src\Markdig.Wpf\Renderers\Wpf\Inlines\LinkInlineRenderer.cs:line
34
>    at Markdig.Renderers.MarkdownObjectRenderer`2.Write(RendererBase renderer, MarkdownObject obj)
>    at Markdig.Renderers.RendererBase.Write[T](T obj)
>    at Markdig.Renderers.RendererBase.WriteChildren(ContainerInline containerInline)
>    at Markdig.Renderers.RendererBase.Write[T](T obj)
>    at Markdig.Renderers.WpfRenderer.WriteLeafInline(LeafBlock leafBlock) in markdig.wpf\src\Markdig.Wpf\Renderers\WpfRenderer.cs:line 82
Using XamlAnimatedGif, if the link is a gif we use the AnimationBehavior to create an animated gif image source.
Non .gif links continue to be generated as bitmapimage
@davidholsgrove
Copy link
Contributor Author

Hi @Kryptos-FR,
I added an additional commit, which uses the https://github.com/XamlAnimatedGif/XamlAnimatedGif project to create ".gif" links as animated gifs instead of static bitmaps.

Happy to split out into separate PR if you'd prefer.

thanks for all your work on markdig.wpf - its awesome 👍
thanks,
David

@Kryptos-FR
Copy link
Owner

Thanks.

I would rather have the animated gif in a separate pull-request. Ideally it should be an option/plugin to use it or not.

@Kryptos-FR
Copy link
Owner

Sorry I didn't have time recently to spend on Markdig.Wpf. I'll extract (cherry-pick) your commit that fixes the URL and review later the rest of the PR.

Thanks again for the contribution.

@Kryptos-FR
Copy link
Owner

I'm closing this PR since the related changes have been merged already. Feel free to open a new one for the GIF part.

@Kryptos-FR Kryptos-FR closed this Nov 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants