Skip to content

Commit

Permalink
Merge pull request #34 from Sarafian/33-syntax-of-line-in-new-mdquote
Browse files Browse the repository at this point in the history
GH-33 Fixed multi line issue with New-MDQuote
  • Loading branch information
Sarafian authored May 31, 2024
2 parents cf2ea24 + 3e0c120 commit af689e2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**v1.10** *20240531*
- Fixed issue with GH-33 where the `New-MDQuote` would output extra `> ` between quote lines

**v1.9** *20200227*
- Based on GH-20 the default output of `New-MDTable` has a cell length alignment per column. New parameter `-Shrink` is added to reduce the overall size and each cell is not padded. Thanks to @al-cheb

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ $markdown
> Multi line quote
>
> > Line 1
> >
> > Line 2
>
> # Links
Expand Down
2 changes: 1 addition & 1 deletion Src/Modules/MarkdownPS/MarkdownPS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"RootModule"="MarkdownPS.psm1"
"Description"="PowerShell module for Semantic Version"
"Guid"="c1e7cbac-9e47-4906-8281-5f16471d7ccd"
"ModuleVersion"="1.9"
"ModuleVersion"="2.0"
# Optional fields
"Author"="Alex Sarafian"
# "CompanyName" = "Company name"
Expand Down
16 changes: 8 additions & 8 deletions Src/Modules/MarkdownPS/Public/New-MDQuote.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Describe -Tag @("MarkdownPS","Cmdlet","Public","New-MDQuote") "New-MDQuote" {
@("Line 1") | New-MDQuote | Should -Be $expected
}
It "-Lines count is 2 & -Level not specified" {
$expected="> Line 1"+$newLine+">"+$newLine+"> Line 2"+$newLine+$newLine
$expected="> Line 1"+$newLine+"> Line 2"+$newLine+$newLine
New-MDQuote -Lines @("Line 1","Line 2") | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote | Should -Be $expected
}
Expand All @@ -52,17 +52,17 @@ Describe -Tag @("MarkdownPS","Cmdlet","Public","New-MDQuote") "New-MDQuote" {
@("Line 1") | New-MDQuote -Level $level | Should -Be $expected
}
It "-Lines count is 2 & -Level provided" {
$expected="> Line 1"+$newLine+">"+$newLine+"> Line 2"+$newLine+$newLine
$expected="> Line 1"+$newLine+"> Line 2"+$newLine+$newLine
$level=1
New-MDQuote -Lines @("Line 1","Line 2") -Level $level | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -Level $level | Should -Be $expected

$expected=">> Line 1"+$newLine+">>"+$newLine+">> Line 2"+$newLine+$newLine
$expected=">> Line 1"+$newLine+">> Line 2"+$newLine+$newLine
$level=2
New-MDQuote -Lines @("Line 1","Line 2") -Level $level | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -Level $level | Should -Be $expected

$expected=">>> Line 1"+$newLine+">>>"+$newLine+">>> Line 2"+$newLine+$newLine
$expected=">>> Line 1"+$newLine+">>> Line 2"+$newLine+$newLine
$level=3
New-MDQuote -Lines @("Line 1","Line 2") -Level $level | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -Level $level | Should -Be $expected
Expand All @@ -78,7 +78,7 @@ Describe -Tag @("MarkdownPS","Cmdlet","Public") "New-MDQuote -NoNewLine specifie
@("Line 1") | New-MDQuote -NoNewLine | Should -Be $expected
}
It "-Lines count is 2 & -Level not specified" {
$expected="> Line 1"+$newLine+">"+$newLine+"> Line 2"+$newLine
$expected="> Line 1"+$newLine+"> Line 2"+$newLine
New-MDQuote -Lines @("Line 1","Line 2") -NoNewLine | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -NoNewLine | Should -Be $expected
}
Expand All @@ -105,17 +105,17 @@ Describe -Tag @("MarkdownPS","Cmdlet","Public") "New-MDQuote -NoNewLine specifie
@("Line 1") | New-MDQuote -Level $level -NoNewLine | Should -Be $expected
}
It "-Lines count is 2 & -Level provided" {
$expected="> Line 1"+$newLine+">"+$newLine+"> Line 2"+$newLine
$expected="> Line 1"+$newLine+"> Line 2"+$newLine
$level=1
New-MDQuote -Lines @("Line 1","Line 2") -Level $level -NoNewLine | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -Level $level -NoNewLine | Should -Be $expected

$expected=">> Line 1"+$newLine+">>"+$newLine+">> Line 2"+$newLine
$expected=">> Line 1"+$newLine+">> Line 2"+$newLine
$level=2
New-MDQuote -Lines @("Line 1","Line 2") -Level $level -NoNewLine | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -Level $level -NoNewLine | Should -Be $expected

$expected=">>> Line 1"+$newLine+">>>"+$newLine+">>> Line 2"+$newLine
$expected=">>> Line 1"+$newLine+">>> Line 2"+$newLine
$level=3
New-MDQuote -Lines @("Line 1","Line 2") -Level $level -NoNewLine | Should -Be $expected
@("Line 1","Line 2") | New-MDQuote -Level $level -NoNewLine | Should -Be $expected
Expand Down
8 changes: 4 additions & 4 deletions Src/Modules/MarkdownPS/Public/New-MDQuote.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ function New-MDQuote {

Process {
$Lines|ForEach-Object {
if($output -ne "")
{
$output+="$prefix"+[System.Environment]::NewLine
}
# if($output -ne "")
# {
# $output+="$prefix"+[System.Environment]::NewLine
# }
$output+="$prefix "+$_+[System.Environment]::NewLine
}
}
Expand Down

0 comments on commit af689e2

Please sign in to comment.