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

Markdown output should escape the output #1839

Open
stephentoub opened this issue Nov 12, 2021 · 2 comments · May be fixed by #1901
Open

Markdown output should escape the output #1839

stephentoub opened this issue Nov 12, 2021 · 2 comments · May be fixed by #1901

Comments

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Nov 12, 2021

Various characters (e.g. |) if used in a Params will end up invalidating the generated markdown, causing it to render incorrectly. It'd be helpful if benchmarkdotnet could escape the markdown output, e.g. output \| instead of |.

@adamsitnik
Copy link
Member

@adamsitnik adamsitnik commented Nov 15, 2021

I've marked the issue as up-for-grabs. Here are some hints for contributors interested in fixing the issue:

  • The tests for markdown exporter can be found here. Simplest way of testing that would be adding a new type with some [Params("$needToBeEscaped", "$doesNotNeedToBeEscaped")] public string Name field. And a file for expected output here
  • The logic that needs to be fixed can be found here

@mawosoft
Copy link
Contributor

@mawosoft mawosoft commented Nov 15, 2021

This should IMHO exclude the Console Markdown exporter and rely on an escape flag like the existing EscapeHtml.
I'm reasonably familiar with GitHub Markdown, but not with the other flavors - there might be different character sets to escape depending on dialect.

(The easiest workaround is to just use the Console exporter and put it in a code fence)

@bakermo bakermo linked a pull request Jan 28, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants