-
Notifications
You must be signed in to change notification settings - Fork 175
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
Incorrect parsing of fenced code blocks inside quoted blocks when followed by another fenced code outside quoted block #126
Comments
This patch to |
I think I tried fixing this a while back, but the fix failed to pass the
test suite I have for mmarkdown/mmark
…On Wed, 7 Aug 2019, 13:05 Artyom Pervukhin, ***@***.***> wrote:
This patch to testdata/FencedCodeInsideBlockquotes.tests illustrates the
issue:
bug126-test.zip
<https://github.com/gomarkdown/markdown/files/3476644/bug126-test.zip>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#126?email_source=notifications&email_token=AACWIW3TRM2TUUWDWSACWMDQDKT6TA5CNFSM4IJYQZH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3YBGEQ#issuecomment-519050002>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACWIW2RQBVD4APXEOA2VZDQDKT6TANCNFSM4IJYQZHQ>
.
|
shorter example
|
Bug is still not corrected. Is this gomarkdown module supported ? |
A minimized test case: > ```
> fenced 1
> ```
```
fenced 2
``` We generate: <blockquote>
<pre><code>> fenced 1
> ```
</code></pre>
<p>fenced 2
“`</p>
</blockquote> It should be more like: <blockquote>
<p>
<code>
fenced 1
</code>
</p>
</blockquote>
<p>
<code>
fenced 2
</code>
</p> The issue seems to be that we don't recognize code block ending inside |
Seems like |
Tried to modify if insideBlockquote {
// skip '>' prefix
pre := p.quotePrefix(data[beg:])
if pre > 0 {
beg += pre
}
} but it's more complicated than that. Would have to strip More complicated than I thought. |
When fenced code block is matched inside quote block that's followed later by some non-quoted fenced code block, it is incorrectly parsed, matching end of fenced code block greedily.
Try parsing and then rendering this text:
It's incorrectly parsed/rended to this html:
Please see this gist with complete code reproducing this output (also notice how github parser/renderer handles this case as expected).
The text was updated successfully, but these errors were encountered: