Skip to content

Commit

Permalink
set description as cdata
Browse files Browse the repository at this point in the history
  • Loading branch information
majkinetor committed Sep 20, 2017
1 parent f7e2460 commit 961f41f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions AU/Public/Set-DescriptionFromReadme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ function Set-DescriptionFromReadme{
[int] $SkipLast=0
)

'Setting README.md to Nuspec description tag'
'Setting package description from README.md'

$description = gc README.md -Encoding UTF8
$endIdx = $description.Length - $SkipLast
$description = $description | select -Index ($SkipFirst..$endIdx) | Out-String
$description = "<![CDATA[" + $description + "]]>"

$Package.NuspecXml.package.metadata.description = $description
$cdata = $Package.NuspecXml.CreateCDataSection($description)
$xml_Description = $Package.NuspecXml.GetElementsByTagName('description')[0]
$xml_Description.RemoveAll()
$xml_Description.AppendChild($cdata)

$Package.SaveNuspec()
}
}

0 comments on commit 961f41f

Please sign in to comment.