You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Blockquote with included code inside
Lorum ipsum dolor sit amet.
> But do included code blocks...?
>
> ```rust
> {{#include another-included-test.rs}}
> ```
>
> By Quote Author
And here's the HTML I get when doing mdbook build, note the multiple <blockquote>s (I'd expect only one opening and one closing):
<h2><a class="header" href="#blockquote-with-included-code-inside" id="blockquote-with-included-code-inside">Blockquote with included code inside</a></h2>
<p>Lorum ipsum dolor sit amet.</p>
<blockquote>
<p>But do included code blocks...?</p>
<pre><pre class="playpen"><code class="language-rust">fn main() {
</code></pre></pre>
</blockquote>
<pre><code>println!("This is a file!");
</code></pre>
<p>}</p>
<blockquote>
<pre><code>
By Quote Author
</code></pre>
</blockquote>
And a screenshot of this:
If I use the markdown renderer instead, I see that after processing the include, the markdown looks like this:
## Blockquote with included code inside
Lorum ipsum dolor sit amet.
> But do included code blocks...?
>
> ```rust
> fn main() {
println!("This is a file!");
}
> ```
>
> By Quote Author
but the markdown that needs to be generated is this:
## Blockquote with included code inside
Lorum ipsum dolor sit amet.
> But do included code blocks...?
>
> ```rust
> fn main() {
> println!("This is a file!");
> }
> ```
>
> By Quote Author
I was going to try to fix this by taking whatever text appears on the same line before the include directive (so in this case > ) and then repeating that text before each line of the included file, but tests like this one show that inline includes are supported (that example would mean "Some random text with " would be prepended to every included line :().
Limiting the recognized text to something like only > would miss cases where there's a blockquote inside a blockquote or a blockquote inside a list or other edge cases I'm not thinking of.
So I don't know how to fix this, and I'm opening this to see if anyone else has ideas, or at least to document that this doesn't work :(
The text was updated successfully, but these errors were encountered:
Much-delayed follow-up (after getting here via the source for TRPL): since #1003 landed, is this tractable? I ask jus tin case someone already knows off the top of their head; otherwise I will just poke at it and figure it out!
I'm using mdbook v0.3.5.
Here's the markdown I tried to write:
And here's the HTML I get when doing
mdbook build
, note the multiple<blockquote>
s (I'd expect only one opening and one closing):And a screenshot of this:
If I use the markdown renderer instead, I see that after processing the
include
, the markdown looks like this:but the markdown that needs to be generated is this:
I was going to try to fix this by taking whatever text appears on the same line before the
include
directive (so in this case>
) and then repeating that text before each line of the included file, but tests like this one show that inlineinclude
s are supported (that example would mean "Some random text with " would be prepended to every included line :().Limiting the recognized text to something like only
>
would miss cases where there's a blockquote inside a blockquote or a blockquote inside a list or other edge cases I'm not thinking of.So I don't know how to fix this, and I'm opening this to see if anyone else has ideas, or at least to document that this doesn't work :(
The text was updated successfully, but these errors were encountered: