代码之家  ›  专栏  ›  技术社区  ›  Tim Long

为什么vs代码会破坏我的标记限制代码块?

  •  0
  • Tim Long  · 技术社区  · 6 年前

    我正在创建一个带有一些csharp代码块的标记文档。下面是一个示例:

    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

    如果我使用search和replace将所有代码说明符都改回来,同样的事情也会发生。这会破坏代码格式!!整个文件也被重新流动,以删除我放入的所有换行符(这可能是一个线索)。

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

    世界跆拳道联盟?为什么vs代码要这么做?我试过禁用降价扩展,同样的事情也发生了。有什么想法吗?

    0 回复  |  直到 6 年前
        1
  •  0
  •   Tim Long    6 年前

    通过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"
    }
    

    感谢并感谢 monofon (基于pandoc的vs代码扩展的作者)for steering me to this solution .