by
3 8
0
3
2,520
0
Top 1% !
Famous
Specified
Popularity: 6782nd place
No tags for this snippet yet.
LanguageMarkdown
SourceGitHub
SourceMyGists

This is a copy of https://meta.discourse.org/t/certain-info-strings-on-fenced-code-blocks-break-formatting-between-the-blocks/42467

This is a copy of https://meta.discourse.org/t/certain-info-strings-on-fenced-code-blocks-break-formatting-between-the-blocks/42467: 
discourse_fence_bug.md
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1242056/This-is-a-copy-of-https---meta-discourse?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
I just encountered a bug while I was writing a post on a Discourse-powered forum and would like to report it. It seems like if I have two fenced code blocks with an info string of "{.cpp}", where each block starts with a line equal to "\`\`\`{.cpp}" and ends with a line equal to "\`\`\`", then any text formatting between the two blocks of code does not work at all, and we see the markup instead of seeing nicely-formatted text. See below for an example: ```{.cpp} // Here is a block of C++ code. ``` For some reason we cannot have `monospace`, _italic_, **bold**, or [link](https://example.com) text in this paragraph, which is between two blocks of C++ code. In fact, I can't find any other Markdown, BBCode or HTML that does work in this area. We can't even have multiple paragraphs. ```{.cpp} // Here is a second block of C++ code. ``` A workaround for this is to remove the `{.cpp}` info string on the first code block, but of course that destroys the code highlighting in that first block. I couldn't find any better solution even though I tried info strings of ".cpp", "cpp", and "c++". I made a [copy of this post as a Gist](https://gist.github.com/DavidEGrayson/05e71787bd36139f59088f59101a04a5) so you can see the markup I used and verify that it works correctly in GitHub-flavored Markdown. --David
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus