MD preview does not show backslashes #549

Closed
opened 2026-01-29 14:39:27 +00:00 by claunia · 2 comments
Owner

Originally created by @dst-RobertKnienider on GitHub (Aug 22, 2022).

Source
This bug was initially reported as https://github.com/madskristensen/MarkdownEditor2022/issues/70.
madskristensen asked me to post it here, as "This is the rendering component that the extension uses to render the HTML from the markdown source file."

Describe the bug
MarkdownEditor2022 preview does not show backslashes the same way Azure DevOps and Visual Studio Code do.
Tested with Visual Studio Professional 2022 (64-bit) Version 17.3.1.

To Reproduce
Preview attached minimal markdown file README.md with MarkdownEditor2022 and Azure DevOps and and Visual Studio Code respectively.

Expected behavior
MarkdownEditor2022 preview shows backslashes the same way Azure DevOps and Visual Studio Code do.

Screenshots

  • MarkdownEditor2022 (VS 17.3.1) preview
    grafik

  • Azur DevOps preview
    grafik

  • Visual Studio Code (1.70.1 6d9b74a) preview
    grafik

Motivation
Documenting Infrasctructure as Code I want to be able to read and copy Windows and UNC paths from Markdown, e.g. within PowerShell commands.

Originally created by @dst-RobertKnienider on GitHub (Aug 22, 2022). **Source** This bug was initially reported as https://github.com/madskristensen/MarkdownEditor2022/issues/70. [madskristensen](https://github.com/madskristensen) asked me to post it here, as "This is the rendering component that the extension uses to render the HTML from the markdown source file." **Describe the bug** MarkdownEditor2022 preview does not show backslashes the same way Azure DevOps and Visual Studio Code do. Tested with Visual Studio Professional 2022 (64-bit) Version 17.3.1. **To Reproduce** Preview attached minimal markdown file [README.md](https://github.com/madskristensen/MarkdownEditor2022/files/9392475/README.md) with [MarkdownEditor2022](https://github.com/madskristensen/MarkdownEditor2022) and Azure DevOps and and Visual Studio Code respectively. **Expected behavior** MarkdownEditor2022 preview shows backslashes the same way Azure DevOps and Visual Studio Code do. **Screenshots** - MarkdownEditor2022 (VS 17.3.1) preview ![grafik](https://user-images.githubusercontent.com/111734686/185871671-0c762c00-8cad-4644-a0dc-560a886cde12.png) - Azur DevOps preview ![grafik](https://user-images.githubusercontent.com/111734686/185871772-c1d709cc-0953-42f0-a7fd-46f880aeb910.png) - Visual Studio Code (1.70.1 6d9b74a) preview ![grafik](https://user-images.githubusercontent.com/111734686/185872785-651ea864-a897-4518-bb6f-bfb4f405ad56.png) **Motivation** Documenting Infrasctructure as Code I want to be able to read and copy Windows and UNC paths from Markdown, e.g. within PowerShell commands.
claunia added the question label 2026-01-29 14:39:27 +00:00
Author
Owner

@xoofx commented on GitHub (Aug 22, 2022):

So the following markdown is producing the correct output for Markdig here (look for markdig (advanced))

Backslash in Markdown Previews

|Count|Code|Markup|
|:--|:--|:--|
|Single|inside| `\` |
|Single|outside| \ |
|Double|inside| `\\` |
|Double|outside| \\ |

Markdig HTML output

<p>
  Backslash in Markdown Previews
</p>
<table>
  <thead>
    <tr>
      <th style="text-align: left;">
        Count
      </th>
      <th style="text-align: left;">
        Code
      </th>
      <th style="text-align: left;">
        Markup
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: left;">
        Single
      </td>
      <td style="text-align: left;">
        inside
      </td>
      <td style="text-align: left;">
        <code>
          \
        </code>
      </td>
    </tr>
    <tr>
      <td style="text-align: left;">
        Single
      </td>
      <td style="text-align: left;">
        outside
      </td>
      <td style="text-align: left;">
        \
      </td>
    </tr>
    <tr>
      <td style="text-align: left;">
        Double
      </td>
      <td style="text-align: left;">
        inside
      </td>
      <td style="text-align: left;">
        <code>
          \\
        </code>
      </td>
    </tr>
    <tr>
      <td style="text-align: left;">
        Double
      </td>
      <td style="text-align: left;">
        outside
      </td>
      <td style="text-align: left;">
        \
      </td>
    </tr>
  </tbody>
</table>

So the HTML output from Markdig looks correct to me. I don't know why MarkdownEditor2022 is displaying something different, but looks more a bug there (sorry for the ping-pong!)

@xoofx commented on GitHub (Aug 22, 2022): So the following markdown is producing the correct output for Markdig [here](https://babelmark.github.io/?text=Backslash+in+Markdown+Previews%0A%0A%7CCount%7CCode%7CMarkup%7C%0A%7C%3A--%7C%3A--%7C%3A--%7C%0A%7CSingle%7Cinside%7C+%60%5C%60+%7C%0A%7CSingle%7Coutside%7C+%5C+%7C%0A%7CDouble%7Cinside%7C+%60%5C%5C%60+%7C%0A%7CDouble%7Coutside%7C+%5C%5C+%7C) (look for `markdig (advanced)`) ```md Backslash in Markdown Previews |Count|Code|Markup| |:--|:--|:--| |Single|inside| `\` | |Single|outside| \ | |Double|inside| `\\` | |Double|outside| \\ | ``` Markdig HTML output ```html <p> Backslash in Markdown Previews </p> <table> <thead> <tr> <th style="text-align: left;"> Count </th> <th style="text-align: left;"> Code </th> <th style="text-align: left;"> Markup </th> </tr> </thead> <tbody> <tr> <td style="text-align: left;"> Single </td> <td style="text-align: left;"> inside </td> <td style="text-align: left;"> <code> \ </code> </td> </tr> <tr> <td style="text-align: left;"> Single </td> <td style="text-align: left;"> outside </td> <td style="text-align: left;"> \ </td> </tr> <tr> <td style="text-align: left;"> Double </td> <td style="text-align: left;"> inside </td> <td style="text-align: left;"> <code> \\ </code> </td> </tr> <tr> <td style="text-align: left;"> Double </td> <td style="text-align: left;"> outside </td> <td style="text-align: left;"> \ </td> </tr> </tbody> </table> ``` So the HTML output from Markdig looks correct to me. I don't know why MarkdownEditor2022 is displaying something different, but looks more a bug there (sorry for the ping-pong!)
Author
Owner

@dst-RobertKnienider commented on GitHub (Aug 22, 2022):

Thanks for the immediate response!
I'll switch serving side again ;-)

@dst-RobertKnienider commented on GitHub (Aug 22, 2022): Thanks for the immediate response! I'll switch serving side again ;-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#549