Skip to content

Commit

Permalink
remove trailing newline
Browse files Browse the repository at this point in the history
fixes #431
  • Loading branch information
SimonCropp committed Nov 19, 2021
1 parent a291132 commit 5355ee3
Show file tree
Hide file tree
Showing 26 changed files with 8 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/mdsource/github-action.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ This action performs the following tasks:

## More Info

* [Software installed on GitHub-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners)
* [Software installed on GitHub-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners)
2 changes: 1 addition & 1 deletion docs/mdsource/header.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ To insert a newline use `\n`

```ps
mdsnippets --header "GENERATED FILE\nSource File: {relativePath}"
```
```
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591</NoWarn>
<Version>24.2.0</Version>
<Version>24.2.1</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<PackageTags>Markdown, Snippets, mdsnippets, documentation, MarkdownSnippets</PackageTags>
<Description>Extracts snippets from code files and merges them into markdown documents.</Description>
Expand Down
6 changes: 5 additions & 1 deletion src/MarkdownSnippets/Processing/MarkdownProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,14 @@ public ProcessResult Apply(TextReader textReader, TextWriter writer, string? fil
var lines = Lines.ReadAllLines(textReader, null).ToList();
writer.NewLine = newLine;
var result = Apply(lines, newLine, file);
foreach (var line in lines)

for (var index = 0; index < lines.Count - 1; index++)
{
var line = lines[index];
writer.WriteLine(line.Current);
}

writer.Write(lines.Last().Current);

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ before
** Could not find include 'theKey' ** <!-- singleLineInclude: theKey -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ c
d
```
<!-- endSnippet -->

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ From
File
```
<!-- endSnippet -->

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@ From
File
```
<!-- endSnippet -->

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ Text1
## Heading 2

Text2

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ Snippet
<!-- endInclude -->

some other text

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ Snippet
<!-- endInclude -->

some other text

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ some text
<!-- endInclude -->

some other text

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ Text1
## Heading 2

Text2

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ Text1
## Heading 2

Text2

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ This document has no headings.

An empty toc section should be generated, in case
any headings are added in future.

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ Text1
## Heading 2

Text2

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ theValue1 <!-- include: theKey. path: /thePath -->
theValue2 <!-- endInclude -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ one <!-- include: theKey. path: /thePath -->
two <!-- endInclude -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ before
<!-- endInclude -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ theValue1 <!-- include: theKey. path: /thePath -->
theValue2 <!-- endInclude -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ long
Snippet <!-- endInclude -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ theValue2
theValue3 <!-- endInclude -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ before
theValue1 <!-- singleLineInclude: theKey. path: /thePath -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ before
theValue1 <!-- singleLineInclude: theKey. path: /thePath -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ before
Snippet <!-- singleLineInclude: theKey. path: thePath -->

after

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ the <!-- include: theKey. path: thePath -->
Snippet <!-- endInclude -->

after

}

0 comments on commit 5355ee3

Please sign in to comment.