Ghost: Certain uses of backticks break code block rendering

Created on 11 Oct 2016  路  7Comments  路  Source: TryGhost/Ghost

Issue Summary

When backticks are used in certain ways it can break code block rendering

Steps to Reproduce

  1. Create a new post
  2. Add the following content:

    ```` code+` ``

    second code block

    third code block
    ``````

  3. Note that the second and third code blocks in the preview both show second code block.
  4. Remove the very last backtick
  5. Note that the second code block shows undefined
  6. Replace the backtick removed in step 4 and remove the single backtick after the + from the first code block
  7. Note that all code blocks now render

backtick-issue

Technical details:

  • Ghost Version: 0.9.0
  • Node Version: 6.6
  • Browser/OS: macOS, Chrome
  • Database: Sqlite3

I try in safari, it is all the same.

bug server / core

All 7 comments

Hey @hzb,

Sorry to hear you're having trouble but I'm not entirely sure what you are attempting to achieve. I tried to follow your instructions by writing the code you provided in a markdown code block but both the preview and final post always displayed the full text (see image below). The same text outside of a code block also rendered the full text.

screen shot 2016-10-12 at 10 10 12

I'll close this for now as it sounds like it's possibly a theme issue or maybe user error, if you can provide a clear reproduction case I can re-open. I also suggest popping over to our Slack channel and asking in #help too - it may be easier to explain what you are attempting to do in chat.

@kevinansfield NO, you can't close this issue, I tested all versions of ghost, from 0.1 to current version, this isn't an issue, i think it's a bug. I record a video, can you give me your email address, I will send it to you.

@hzb please attach a link to the video here on this issue or provide concrete reproduction steps, as I said before we can re-open if a bug is found/proven

@kevinansfield Please download the video from here

https://www.dropbox.com/s/brl5elvtdow5nc0/markdown_error_ghost.mp4?dl=0

In ghost.io and all ghost versions.

ghost_wrong

look at two sides contents, do you still think it's right?

In other markdown editor, this is real right.

this_right

@ErisDS @kevinansfield can you open this issue?

@hzb thank's for following up with a reproducible test case, I've edited your original issue so that it's clear what the problem is.

We're currently working towards Ghost 1.0 which will have a completely new editor but I've re-opened so that this can be tracked for the LTS branch and for any backwards-compatible markdown support that may be added to the new editor.

@kevinansfield welcome.

Was this page helpful?
0 / 5 - 0 ratings