Skip to content

Commit

Permalink
Merge pull request #15 from Sarafian/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sarafian committed Apr 20, 2016
2 parents 7332696 + 39f1f96 commit 048fbbd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**20160420**
- Within `New-MDImage` `[System.Uri]::EscapeDataString` is not escaping `(`,`)` when not executing from withing ise. Don't know why. Fixed with extra replacements.

**20160419**
- With `New-MDImage` changed parameter `-Link` to `-Source` to drive the image source.
- With `New-MDImage` added parameter `-Link` to make a link image.
Expand Down
6 changes: 3 additions & 3 deletions Modules/MarkdownPS/New-MDImage.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Describe "New-MDImage" {
New-MDImage -Subject $subject -Status $status -Color $color | Should Be $expected
}
It "With special chars" {
$subject="dash-underscor_space ."
$status="dash-underscor_space ."
$subject="dash-underscore_parenthesis()space ."
$status="dash-underscore_parenthesis()space ."
$color="green"
$expected="![](https://img.shields.io/badge/dash--underscor__space%20.-dash--underscor__space%20.-$color.svg)"
$expected="![](https://img.shields.io/badge/dash--underscore__parenthesis%28%29space%20.-dash--underscore__parenthesis%28%29space%20.-$color.svg)"
New-MDImage -Subject $subject -Status $status -Color $color | Should Be $expected
}
It "-Link specified" {
Expand Down
8 changes: 8 additions & 0 deletions Modules/MarkdownPS/New-MDImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ function New-MDImage {

$Status=$Status.Replace("-","--").Replace("_","__")
$Status=[System.Uri]::EscapeDataString($Status)

#When running from powershell [System.Uri]::EscapeDataString is not escaping ()
if(-not $ise)
{
$Subject=$Subject.Replace("(","%28").Replace(")","%29")
$Status=$Status.Replace("(","%28").Replace(")","%29")
}

$shieldIo="$Subject-$Status-$Color"

$Source="https://img.shields.io/badge/$shieldIo.svg"
Expand Down
2 changes: 1 addition & 1 deletion Publish/Version.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Get-Version {
$major=1
$minor=3
$minor=4
$patch=0

return "$major.$minor"
Expand Down

0 comments on commit 048fbbd

Please sign in to comment.