quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
280 stars 19 forks source link

VS Code visual mode mangles wiki-links by adding escape characters: [[original]] -> \[\[modified\]\] #364

Open aswolf opened 5 months ago

aswolf commented 5 months ago

Background

When working with quarto documents, I will often paste from markdown files that include wiki-style links using double brackets. It is fine that quarto (pandoc) do not automatically support automatic linking, but I expect that the text will remain unchanged.

This is a problem because it modifies the document unnecessarily, adding noise to the list of changes from source control. Additionally, the escape'd version is more difficult to parse visually and thus distracts from the writing process. This behavior adds unnecessary friction and distraction to the process of copy-pasting text from Obsidian or other popular wiki-style knowledge management software.

Desired Behavior

I can work with a quarto document (qmd file) containing [[wiki-links]] in source mode in vs code with no problems at all. They are rendered nicely in the preview and are left in place in the source qmd file. This should also hold true when editing in visual mode, but it is not the case.

Reproducing the Problem

If I open the document in visual mode, the quarto extension modifies all the wiki-links text by adding escape characters before the square brackets (e.g. [[wiki-links]]). This modification also occurs every time the document is saved while the visual mode is pane is open and has focus. (Note that if the source mode pane has focus instead, the escape characters are not injected into the document).

Thanks so much for any help addressing this issue.