Skip to content

Visual Editor incorrectly escapes '@' in Pandoc citations on drag-and-drop #859

@ronblum

Description

@ronblum

Bug description

The following was reported by @crocodilusniloticus in RStudio repo rstudio/rstudio rstudio/rstudio#16537

When dragging a plain-text Pandoc citation (e.g., [@smith2023]) from an external application like Zotero into the RStudio Visual Editor, the editor incorrectly escapes the at-sign, resulting in \[@smith2023].

Steps to Reproduce:
1. Configure Zotero with Better BibTeX to drag citations as plain-text Pandoc citations.
2. Drag a reference from Zotero into a plain text editor (like the RStudio Source Editor) to confirm it is correctly formatted as [@key].
3. Drag the same reference into the RStudio Visual Editor.

**Expected Behavior:**
The editor should insert the plain text as-is: `[@key]`

**Actual Behavior:**
The editor inserts escaped text: `\@key`, which breaks the Pandoc citation functionality."

Steps to reproduce

No response

Actual behavior

No response

Expected behavior

No response

Your environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions