Skip to content

Instantly share code, notes, and snippets.

@DavidEGrayson
Last active April 12, 2016 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidEGrayson/05e71787bd36139f59088f59101a04a5 to your computer and use it in GitHub Desktop.
Save DavidEGrayson/05e71787bd36139f59088f59101a04a5 to your computer and use it in GitHub Desktop.

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:

// Here is a block of C++ code.

For some reason we cannot have monospace, italic, bold, or link 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.

// 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 so you can see the markup I used and verify that it works correctly in GitHub-flavored Markdown.

--David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment