2

The following comment causes Stack Overflow to render the comment incorrectly, based on the documentation for Comment Formatting:

I think I see what you're doing.  You really only need one example of calling `Start-Process "X:\MSI\YourMsi.msi" "/qn" -PassThru | Wait-Process;\` to make your point.  The rest is just noise; I thought at first that you had to install some of that stuff to get MSI installation to work, when really all you need is `FROM mcr.microsoft.com/windows/servercore:ltsc2019` or any Docker image that allows running PowerShell Core scripts (`microsoft/windowsservercore:latest` is dependent on the Docker registry's value for latest, so your mileage may vary).

This renders as:

The following seems to work, albeit it's a hack and painful to use:

I think I see what you're doing.  You really only need one example of calling `Start-Process "X:\MSI\YourMsi.msi" "/qn" -PassThru | Wait-Process;\` ` to make your point.  The rest is just noise; I thought at first that you had to install some of that stuff to get MSI installation to work, when really all you need is `FROM mcr.microsoft.com/windows/servercore:ltsc2019` or any Docker image that allows running PowerShell Core scripts (`microsoft/windowsservercore:latest` is dependent on the Docker registry's value for latest, so your mileage may vary).
2
  • 1
    TL;DR: OP disagrees that backslash escapes backtick. Commented Nov 7, 2019 at 2:42
  • I don't see where in the documentation escape characters are mentioned, so yes, I disagree that backslash escapes anything. Commented Nov 7, 2019 at 20:01

1 Answer 1

2

I'm not sure this is really a bug. Comments use a special variant of Markdown, called "mini-Markdown". This isn't quite the same Markdown that is used for formatting posts (i.e., questions and answers).

The issue in your case is arising from this sequence:

\`

The backslash works as an escape character, preventing the subsequent backtick from terminating the inline code block.

A better workaround would be using multiple backticks, which disable the escaping inside that sequence altogether. This renders correctly:

I think I see what you're doing.  You really only need one example of calling ```Start-Process "X:\MSI\YourMsi.msi" "/qn" -PassThru | Wait-Process;\``` to make your point.  The rest is just noise; I thought at first that you had to install some of that stuff to get MSI installation to work, when really all you need is `FROM mcr.microsoft.com/windows/servercore:ltsc2019` or any docker image that allows running PowerShell Core scripts (`microsoft/windowsservercore:latest` is dependent on the docker registry's value for latest, so YMMV).

I tried using double backslashes under the assumption that you could escape a backslash with a backslash, but that (surprisingly) didn't work. Again, the explanation is found in balpha's answer:

Codeblocks in single backticks […] behaves like it previously did, and is a slight deviation from the Markdown spec: If the codeblock is enclosed in single backticks, you can escape a backtick (and only a backtick) with a backslash.

Only backticks can be escaped using the backslash escape character. I'm not sure the rationale for that implementation, but it does at least explain the behavior.

1
  • I think I see what you're doing. You really only need one example of calling Start-Process "X:\MSI\YourMsi.msi" "/qn" -PassThru | Wait-Process;\ to make your point. The rest is just noise; I thought at first that you had to install some of that stuff to get MSI installation to work, when really all you need is FROM mcr.microsoft.com/windows/servercore:ltsc2019 or any docker image that allows running PowerShell Core scripts (microsoft/windowsservercore:latest is dependent on the docker registry's value for latest, so YMMV). Commented Nov 7, 2019 at 1:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .