From a34171379f4ba9890c231a352a245384cb517ce8 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Wed, 15 Sep 2021 10:45:25 +1000 Subject: [PATCH] use url for path --- src/MarkdownSnippets/Reading/FileSnippetExtractor.cs | 2 +- .../SnippetExtractorTests.AppendUrlAsSnippet.verified.txt | 2 +- .../SnippetExtractorTests.AppendUrlAsSnippetInline.verified.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MarkdownSnippets/Reading/FileSnippetExtractor.cs b/src/MarkdownSnippets/Reading/FileSnippetExtractor.cs index 5b383168..f0785ef2 100644 --- a/src/MarkdownSnippets/Reading/FileSnippetExtractor.cs +++ b/src/MarkdownSnippets/Reading/FileSnippetExtractor.cs @@ -50,7 +50,7 @@ public static async Task AppendUrlAsSnippet(ICollection snippets, strin throw new SnippetException($"Unable to get UrlAsSnippet: {url}"); } - var snippet = Snippet.Build(1, content!.LineCount(), content!, key, GetLanguageFromPath(url), null); + var snippet = Snippet.Build(1, content!.LineCount(), content!, key, GetLanguageFromPath(url), url); snippets.Add(snippet); using var reader = new StringReader(content!); diff --git a/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippet.verified.txt b/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippet.verified.txt index 69c5dc88..a6368f47 100644 --- a/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippet.verified.txt +++ b/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippet.verified.txt @@ -17,7 +17,7 @@ artifacts: on_failure: - ps: Get-ChildItem *.received.* -recurse | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }, Error: , - FileLocation: null, + FileLocation: https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/src/appveyor.yml(1-13), IsInError: false } ] \ No newline at end of file diff --git a/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippetInline.verified.txt b/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippetInline.verified.txt index b4bcabdf..5a297327 100644 --- a/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippetInline.verified.txt +++ b/src/Tests/SnippetExtractor/SnippetExtractorTests.AppendUrlAsSnippetInline.verified.txt @@ -43,7 +43,7 @@ class Usage } }, Error: , - FileLocation: null, + FileLocation: https://raw.githubusercontent.com/SimonCropp/MarkdownSnippets/master/src/Tests/Snippets/Usage.cs(1-45), IsInError: false }, {