quarto-dev / quarto

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

Image caption formatting lost when switching from Source to Visual mode #355

Open lvclark opened 8 months ago

lvclark commented 8 months ago

Bug description

When I put image caption text in italics, add a link to the image, switch to Source as the editor, then switch back to Visual as the editor, the italics formatting is lost. The example document below reproduces this behavior. (I also lose caption formatting on one of my pages when rendering the document, but am unable to reproduce that behavior with the example below.)

Steps to reproduce

---
title: "Bug Example"
author: "Lindsay Clark"
---

```{r}
png("example_image.png")
plot(1:10, 1:10)
dev.off()

This is a *formatted* caption


### Expected behavior

When I switch back and forth between editors, I expect the formatting to say the same.

### Actual behavior

The asterisks that indicate italics formatting get stripped out of the document. I tried HTML tags, and these are also lost.

### Your environment

- IDE: RStudio/2023.12.0+369
- OS: Windows 11

### Quarto check output

[>] Checking versions of quarto binary dependencies... Pandoc version 3.1.1: OK Dart Sass version 1.55.0: OK [>] Checking versions of quarto dependencies......OK [>] Checking Quarto installation......OK Version: 1.3.450 Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....(None)

  Unable to locate an installed version of Python 3.
  Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK Version: 4.3.1 Path: C:/PROGRA~1/R/R-43~1.1 LibPaths:

[>] Checking Knitr engine render......OK