Skip to content

Commit a607a92

Browse files
PrzemyslawKlysvors
authored andcommitted
Fix for Common and Workflow parameters autowrap (#431)
1 parent 4f89d36 commit a607a92

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

src/Markdown.MAML/Renderer/Markdownv2Renderer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ private void AddParameters(MamlCommand command)
186186
private void AddCommonParameters()
187187
{
188188
AddHeader(ModelTransformerBase.PARAMETERSET_NAME_HEADING_LEVEL, MarkdownStrings.CommonParametersToken, extraNewLine: false);
189-
AddParagraphs(MarkdownStrings.CommonParametersText);
189+
AddParagraphs(MarkdownStrings.CommonParametersText, noNewLines: false, skipAutoWrap: true);
190190
}
191191

192192
private void AddWorkflowParameters()
193193
{
194194
AddHeader(ModelTransformerBase.PARAMETERSET_NAME_HEADING_LEVEL, MarkdownStrings.WorkflowParametersToken, extraNewLine: false);
195-
AddParagraphs(MarkdownStrings.WorkflowParametersText);
195+
AddParagraphs(MarkdownStrings.WorkflowParametersText, noNewLines: false, skipAutoWrap: true);
196196
}
197197

198198
private Dictionary<string, MamlParameter> GetParamSetDictionary(string parameterName, List<MamlSyntax> syntaxes)
@@ -534,14 +534,14 @@ private string GetAutoWrappingForMarkdown(string[] lines)
534534
return string.Join(NewLine, newLines);
535535
}
536536

537-
private void AddParagraphs(string body, bool noNewLines = false)
537+
private void AddParagraphs(string body, bool noNewLines = false, bool skipAutoWrap = false)
538538
{
539539
if (string.IsNullOrWhiteSpace(body))
540540
{
541541
return;
542542
}
543543

544-
if (this._mode != ParserMode.FormattingPreserve)
544+
if (this._mode != ParserMode.FormattingPreserve && skipAutoWrap != true)
545545
{
546546
string[] paragraphs = body.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
547547
body = GetAutoWrappingForMarkdown(paragraphs.Select(para => GetEscapedMarkdownText(para.Trim())).ToArray());

test/Markdown.MAML.Test/Renderer/MarkdownV2RendererTests.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,10 @@ Workflow [<WorkflowCommonParameters>] [<CommonParameters>]
297297
## PARAMETERS
298298
299299
### WorkflowCommonParameters
300-
This cmdlet supports the following workflow common parameters: -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName, and -InputObject.
301-
For more information, see about_WorkflowCommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=533952).
300+
This cmdlet supports the following workflow common parameters: -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName, and -InputObject. For more information, see about_WorkflowCommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=533952).
302301
303302
### CommonParameters
304-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
305-
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
303+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
306304
307305
## INPUTS
308306
@@ -343,8 +341,7 @@ public void RendererNormalizeQuotesAndDashes()
343341
## PARAMETERS
344342
345343
### CommonParameters
346-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
347-
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
344+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
348345
349346
## INPUTS
350347
@@ -507,8 +504,7 @@ Parameter Description.
507504
```
508505
509506
### CommonParameters
510-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
511-
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
507+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
512508
513509
## INPUTS
514510
@@ -655,8 +651,7 @@ public void RenderesAllParameterSetMoniker()
655651
```
656652
657653
### CommonParameters
658-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
659-
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
654+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
660655
661656
## INPUTS
662657

0 commit comments

Comments
 (0)