line wrapping in visual markdown breaks bookdown text reference

Hi everyone. I am using the new markdown editor in Rstudio 1.4.1056. In this I can set the line wrapping to 'sentence' ( ) which I think is really helpful when using it for manuscripts with a lot of text in combination with GIT version control.

However, a bookdown text reference with multiple sentences will break as soon as I switch to visual markdown editing, since the line wrapping is also performed on the text in the bookdown text reference block. Is there any way to circumvent this behavior and let Rstudio always perform line wrapping except for when a bookdown text reference is used?

The Rmarkdown example below can reproduce the problem (save this code as Rmarkdown, then switch to visual markdown editing).

title: "minimal example"
output: bookdown::html_document2
    wrap: sentence

# Plot

Reference text below with random text:

(ref:pressure) Folly words widow one downs few age every seven. If miss part by fact he park just shew. Discovered had get considered projection who favourable. Necessary up knowledge it tolerably. Unwilling departure education is be dashwoods or an.

```{r pressure, fig.cap="(ref:pressure)"}

Thanks for reporting! Issue filed here:

PR with fix here:

Thanks for the quick response and fix! I can't test it yet of course but I'll wait for the next version. Shall I mark it as the solution already? I really like the recent improvements in Rstudio, thank you to all of the developers!

Yes you can mark it as the solution ! Thanks.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.