Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove-EscapedMarkdownCode: Need to remove code blocks that are escaped #140

Closed
johlju opened this issue Jan 21, 2024 · 0 comments · Fixed by #141
Closed

Remove-EscapedMarkdownCode: Need to remove code blocks that are escaped #140

johlju opened this issue Jan 21, 2024 · 0 comments · Fixed by #141
Labels
bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub

Comments

@johlju
Copy link
Member

johlju commented Jan 21, 2024

Details of the scenario you tried and the problem that is occurring

When markdown is generated by PlatyPS code blocks are escaped. The command Remove-EscapedMarkdownCode should remove those too.

`\``mermaid
`\``

Steps to reproduce the problem

Run the task Generate_Markdown_For_Public_Commands.

Expected behavior

To have a correct code block.

Current behavior

Does not remove escaped code blocks.

Suggested solution to the issue

Add a regex to the command:

$escapedPatterns = @(
@{
RegularExpression = '\\\`(.+?)\\\`' # Remove escaped inline code-blocks
Replacement = '`$1`'
}
@{
RegularExpression = '\\\[(.+?)\\\]' # Remove escaped links
Replacement = '[$1]'
}
@{
RegularExpression = '(?m)^\\\>' # Remove quoted blocks
Replacement = '>'
}
)

The operating system the target node is running

n/a

Version and build of PowerShell the target node is running

n/a

Version of the module that was used

0.16.1

@johlju johlju added bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub help wanted The issue is up for grabs for anyone in the community. labels Jan 21, 2024
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant