VS Code为什么会破坏Markdown围栏的代码块?

时间:2019-02-14 14:46:14

标签: visual-studio-code markdown

我正在用一些CSharp代码块创建一个markdown文档。这是一个示例:

Next, it feeds the strings to the regular expression matcher to produce a sequence of matches.

```csharp
        let patternMatch = azimuthEncoderRegex.Match(message)
```

在编辑器中,这似乎运行良好,如下所示: enter image description here

如您所见,代码已按预期格式设置,并在预览窗口(未显示)中正确显示了格式。

现在,当我保存文件时,上面的文本立即变为: enter image description here

如果我使用搜索替换将所有代码说明符改回原来的位置,则会发生相同的情况。这破坏了代码格式!!整个文件也会重新排序,以删除我放入的所有换行符(可能是一个提示)。

更新:我注意到所有引用样式的超链接也从文档末尾删除,导致数据丢失。

WTF?为什么VS-Code这样做?我尝试禁用Markdown扩展,并且发生了同样的事情。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

由VS代码的settings.json更改解决:

{
    "pandocFormat.command": "pandoc --standalone --atx-headers --wrap=auto --columns=80 -f markdown-auto_identifiers -t markdown-simple_tables-multiline_tables-grid_tables-auto_identifiers-fenced_code_attributes --reference-links"
}

感谢monofonsteering me to this solution(基于Pandoc的VS Code扩展的作者)的贡献。

相关问题