C++ code fence with only 3 backticks not working

darryl.lawson's Avatar

darryl.lawson

30 Jul, 2020 02:28 AM

I'm on macOS using Marked 2.5.43.

This code fence,

```c++
class C {};
```

does not render properly for me. It starts the code block but seems to ignore the closing three ticks.

If I use 4 backticks,

````c++
class C {};
````

or don't specify a language,

```
class C {};
```

or a different language,

```c
class C {};
```

there is no problem.

  1. Support Staff 1 Posted by Brett on 30 Jul, 2020 02:37 AM

    Brett's Avatar

    Try using "cpp" instead of "c++". I don't think it likes the non-alphanumeric characters.

    - Brett

  2. 2 Posted by darryl.lawson on 30 Jul, 2020 02:57 AM

    darryl.lawson's Avatar

    Thanks for the quick reply! "cpp" works!

    Sorry for the confusion, but the snippet in my original post does not reproduce the problem by itself. Two code fence blocks are required:

    ```c++
    class Top {};
    ```
    
    Middle
    
    ```c++
    class Bottom {};
    ```
    

    The above is rendered as a single code block, including "Middle".

  3. Support Staff 3 Posted by Brett on 30 Jul, 2020 10:08 AM

    Brett's Avatar

    But switching to "cpp" does the trick? Just want to make sure I
    understand your last response.

    Thanks,
    Brett

  4. 4 Posted by darryl.lawson on 30 Jul, 2020 11:23 AM

    darryl.lawson's Avatar

    Yeh, switching to "cpp" totally fixes it.

    I was just correcting the record, in case it was something you wished to fix one day. Of course, I understand it wouldn't be high priority, given the easy workaround.

  5. Support Staff 5 Posted by Brett on 30 Jul, 2020 12:25 PM

    Brett's Avatar

    Fixed for the next update.

    Thanks,
    Brett

  6. 6 Posted by darryl.lawson on 30 Jul, 2020 10:27 PM

    darryl.lawson's Avatar

    Legend. Thanks!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac