platyPS
                                
                                 platyPS copied to clipboard
                                
                                    platyPS copied to clipboard
                            
                            
                            
                        New-ExternalHelp not handling escaped characters correctly
New-ExternalHelp misinterprets pairs of escaped markdown characters in a paragraph. Looks like the parser that detects inline syntax such as bold or italic isn't checking for escaped characters.
Steps to reproduce
Create a markdown file with New-MarkdownHelp. Edit the description section as follows:
## DESCRIPTION
One \* asterisk seems to work ok.
There should be \* two \* asterisks in this line of output.
On this line, the word \**two** should be italic with an asterisk before and after.
Then run the markdown through New-ExternalHelp.
Note: The above markdown renders on GitHub as (omitting DESCRIPTION header):
One * asterisk seems to work ok.
There should be * two * asterisks in this line of output.
On this line, the word *two* should be italic with an asterisk before and after.
Expected behavior
Generated XML should be something like:
<maml:description>
  <maml:para>One * asterisk seems to work ok.</maml:para>
  <maml:para>There should be * two * asterisks in this line of output.</maml:para>
  <maml:para>On this line, the word * two * should be italic with an asterisk before and after.</maml:para>
</maml:description>
Actual behavior
Actual XML generated:
<maml:description>
  <maml:para>One * asterisk seems to work ok.</maml:para>
  <maml:para>There should be \ two \ asterisks in this line of output.</maml:para>
  <maml:para>On this line, the word \ two should be italic with an asterisk before and after.</maml:para>
</maml:description>
Environment data
platyPS 0.14.0 PowerShell 7.0 Windows 10 1903
I think you need to escape the trailing asterisk as well. For example:
## DESCRIPTION
One \* asterisk seems to work ok.
There should be \* two \* asterisks in this line of output.
On this line, the word \**two*\* should be italic with an asterisk before and after.
Please test this with 0.14.2 and 2.0-preview1.
I just ran into this today. To get the desired result with two asterisk on one line I used There should be *** two *** asterisks in this line of output.
It works but VSCode show problems from the Markdown linter. MD037/no-space-in-emphasis: Spaces inside emphasis markers
The MAML conversion works totally differently in Microsoft.PowerShell.PlatyPS v1.
This is fixed in Microsoft.PowerShell.PlatyPS v1.