Patrick_David reported a bug where using C++ or c++ as a language hint in a fenced code block breaks the formatting of subsequent text, causing raw markdown to appear. They noted that changing the hint to cpp or leaving it blank resolves the issue, and linked to potential related discussions and the highlight.js repository. Falco confirmed this is a duplicate of a known issue (referenced in post 1) and explained that all such bugs are postponed until the platform switches to the markdown-it parser, which already fixes the problem as demonstrated in their example. Patrick_David acknowledged the information and agreed to wait for the parser switch.
A fenced code block, with language set to C++ ( ```C++):
#include "MIDIUSB.h"
#define ENCODER_PIN_A A3
#define ENCODER_PIN_B A2
#define NUMBER_CLICKS 30 // the number of clicks per rotation of the encoder
#define SLIDER_PIN A1
#define SLIDER_MAX 1015 // my fader has a tiny resistance when completely open
unsigned long loopTime;
uint8_t encoder_state_prev;
uint8_t encoder_pos_prev = 0;
uint8_t slider_7bit_prev = 0;
If you are seeing raw markdown above the test code block, something is amiss.
Changing the language for the first fenced code block to cpp or leaving it blank fixes the problem, but using C++ or c++ both cause it to happen, which is odd if we’re still using highlight.js because it seems to indicate that it should work?
This seems possibly related to this topic:
Though in this case I’m not using curly braces, but normal (I think markdown compliant fenced blocks).
Here is a gist with the top part of this post (apparently working ok on github):