modules/IssueProcessor/Jira/JiraNotes.psm1
using module '..\Issue.psm1' class JiraNotes { [string] $projectName [Issue[]] $issues JiraNotes([string] $projectName, [Issue[]] $issues){ $this.projectName = $projectName $this.issues = $issues } hidden [string] FormatCode([string] $code){ $loop = $true $tagStart = '<pre class="code">' $tagEnd = '</pre>' while (($code) -and $loop){ $i = $code.IndexOf('{code}') if ($i -gt 0){ $j = $code.IndexOf('{code}', $i+6) } else { $j = -1 } if ($i -gt 0 -and $j -gt 0){ $code = $code.Substring(0, $i) + $tagStart + $code.Substring($i+6, $j-($i+6)).Replace('<', '<').Replace('>', '>') ` + $tagEnd + $code.Substring($j+6, $code.Length-($j+6)) } else { $loop = $false } } return $code } } |