File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,17 @@ function Publish-IcingaPluginDocumentation()
126126 foreach ($parameter in $PluginHelp.parameters.parameter ) {
127127 [string ]$ParamDescription = $parameter.description.Text ;
128128 if ([string ]::IsNullOrEmpty($ParamDescription ) -eq $FALSE ) {
129- $ParamDescription = $ParamDescription.Replace (" `r`n " , ' ' );
130- $ParamDescription = $ParamDescription.Replace (" `r " , ' ' );
131- $ParamDescription = $ParamDescription.Replace (" `n " , ' ' );
129+ $ReplacementString = ' <br /> ' ;
130+
131+ $ParamDescription = $ParamDescription.Replace (" `r`n " , $ReplacementString );
132+ $ParamDescription = $ParamDescription.Replace (" `r " , $ReplacementString );
133+ $ParamDescription = $ParamDescription.Replace (" `n " , $ReplacementString );
134+
135+ if ($ParamDescription.Contains (' |' )) {
136+ $ParamDescription = $ParamDescription.Replace (' |' , ' |' );
137+ }
132138 }
139+
133140 [string ]$TableContent = [string ]::Format(
134141 ' | {0} | {1} | {2} | {3} | {4} |' ,
135142 $parameter.name ,
Original file line number Diff line number Diff line change @@ -376,11 +376,19 @@ function Get-IcingaCheckCommandConfig()
376376 $IcingaDataType = [string ]::Format(' Icinga\Module\Director\DataType\DataType{0}' , $IcingaDataType )
377377
378378 if ($Basket.Datafield.Values.varname -ne $IcingaCustomVariable ) {
379+ $DataFieldDescription = $parameter.Description.Text ;
380+
381+ # Remove HTML code tags and replace them with markdown tags
382+ if ([string ]::IsNullOrEmpty($DataFieldDescription ) -eq $FALSE ) {
383+ $DataFieldDescription = $DataFieldDescription.Replace (' <pre>' , ' ```' );
384+ $DataFieldDescription = $DataFieldDescription.Replace (' </pre>' , ' ```' );
385+ }
386+
379387 $Basket.Datafield.Add (
380388 [string ]$FieldID , @ {
381389 ' varname' = $IcingaCustomVariable ;
382390 ' caption' = $parameter.Name ;
383- ' description' = $parameter .Description.Text ;
391+ ' description' = $DataFieldDescription ;
384392 ' datatype' = $IcingaDataType ;
385393 ' format' = $NULL ;
386394 ' originalId' = [string ]$FieldID ;
You can’t perform that action at this time.
0 commit comments