Skip to content

Support fenced code block in list. #5632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vilicvane opened this issue Aug 4, 2015 · 11 comments
Closed

Support fenced code block in list. #5632

vilicvane opened this issue Aug 4, 2015 · 11 comments
Labels
affects:server Issues relating to the server or core of Ghost bug [triage] something behaving unexpectedly

Comments

@vilicvane
Copy link

It would be great if we can do something like this:

  • A list item with some code sample

    console.log('hello, world.');
    
@ErisDS ErisDS added bug [triage] something behaving unexpectedly affects:editor Work relating to the Koenig Editor labels Aug 4, 2015
@minwe
Copy link

minwe commented Aug 11, 2015

Why do not use marked? It should better than showdown.

@ErisDS ErisDS added affects:editor Work relating to the Koenig Editor and removed affects:editor Work relating to the Koenig Editor labels Oct 9, 2015
@ErisDS ErisDS self-assigned this Oct 9, 2015
@tomekr
Copy link

tomekr commented Oct 19, 2015

👍

@vilic Have you found a decent workaround for this in the meantime?

@vilicvane
Copy link
Author

@tomekr sadly no.

@jgillich
Copy link
Contributor

jgillich commented Nov 5, 2015

I think this is showdownjs/showdown#208 and there's an easy solution.

@JohnWestlund
Copy link

@jgillich I can get the work around you posted to work on http://showdownjs.github.io but not in Ghost. The best I've been able to manage is:

1. item one
    ```code 1
    code 2
    ```
2. item two

Which creates what looks like a code block broken in half over two lines:
capturemd

@kevinansfield
Copy link
Member

@JohnWestlund I believe the workaround doesn't used "fenced" code blocks, rather relies on the indentation to indicate a code block. e.g.:

screen shot 2015-11-10 at 12 00 47

@gchandrasa
Copy link

@kevinansfield yes, the indentation work but how do you use syntax highlight without fenced code blocks

 ```language-javascript
 [...]
 ```

@minwe
Copy link

minwe commented Apr 11, 2016

How about this?

2016-04-11 5 02 55

Code blocks nested in blockquote are not rendered correctly. It should be a <pre><code>...</code></pre>, but in Ghost got just <code>

Take below as example:

> Note:
>
> Some code in blockquote.
>
> ```javascript
> function() {
>   consoel.log('hello world!');
> }
> ```

This block is rendered to:

<blockquote>
  <p>Note:</p>

  <p>Some code in blockquote.</p>

  <p><code>javascript
  function() {
    consoel.log('hello world!');
  }
  </code></p>
</blockquote>

The correct result should be:

<blockquote>
  <p>Note:</p>

  <p>Some code in blockquote.</p>

<pre><code class="javascript language-javascript">function() {
  consoel.log('hello world!');
}</code></pre>
</blockquote>

The official demo of Showdown works well.

2016-04-11 5 11 59

Marked works well, too.

So why do not use the official version of Showdown, the Ghost fork is out of date and bugly.

@draveness
Copy link

I really wanna know when will this issue be fixed

@overcache
Copy link

overcache commented Nov 10, 2016

need fixed + 1.

row markdown:

ghost output:

@draveness
Copy link

When will fenced code block be supported in Ghost? Have been waiting for this for a long long time

@ErisDS ErisDS added showdown and removed affects:editor Work relating to the Koenig Editor showdown labels Mar 15, 2017
@kirrg001 kirrg001 added the affects:server Issues relating to the server or core of Ghost label May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:server Issues relating to the server or core of Ghost bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.