-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multline strings formatted incorrectly? #139
Comments
We also have something related in Quarto which uses downlit: quarto-dev/quarto-cli#1165 Chunk to highlight strwrap(
"Volcano plot - Response Size and Significance of Differential
Expression among all miRNA at Baseline", width = 80
) We get a single chunk_content <-
c(
"strwrap(\n \"Volcano plot - Response Size and Significance of Differential\n Expression among all miRNA at Baseline\", width = 80\n)"
)
res <- downlit::highlight(chunk_content, downlit::classes_pandoc())
xfun::raw_string(res)
#> <span class='fu'><a href='https://rdrr.io/r/base/strwrap.html'>strwrap</a></span><span class='op'>(</span>
#> <span class='st'>"Volcano plot - Response Size and Significance of Differential
#> Expression among all miRNA at Baseline"</span>, width <span class='op'>=</span> <span class='fl'>80</span>
#> <span class='op'>)</span> Created on 2022-06-17 by the reprex package (v2.0.1) Related to #133 as Pandoc correctly adds a |
Yeah, I'm pretty sure the problem is multi-line strings. |
Minimal reprex with rmd:
which generates: <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="fu"><a href="https://rdrr.io/r/base/paste.html">paste</a></span><span class="op">(</span><span class="st">"Line 1
Line 2
Line 3"</span>
<span class="op">)</span></code></pre></div> |
And the messed appearance arises because |
Minimal reprex just using downlit: cat(downlit::highlight('paste("Line 1
Line 2
Line 3"
)'))
#> <span class='nf'><a href='https://rdrr.io/r/base/paste.html'>paste</a></span><span class='o'>(</span><span class='s'>"Line 1
#> Line 2
#> Line 3"</span>
#> <span class='o'>)</span> Created on 2022-06-21 by the reprex package (v2.0.1) |
looks like
Because, I think, the multi-line string is put in a single span.
The text was updated successfully, but these errors were encountered: