Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Indentation of nested code block fails after 2nd level #149

Open
cebence opened this issue Nov 14, 2014 · 4 comments
Open

Indentation of nested code block fails after 2nd level #149

cebence opened this issue Nov 14, 2014 · 4 comments

Comments

@cebence
Copy link

cebence commented Nov 14, 2014

Code block indentation fails when it's nested on level 2.

1. first

  ```
  left
    indent
  ```

  1. sasasa

    ```
    left
      indent
    ```

2. second

Second line of the 2nd code block should be indented but it's not:

image

To make it indented one must indent the entire code block by 2 more spaces.

The same input renders correctly on Github:

image

@benogle benogle added the bug label Nov 14, 2014
@izuzak
Copy link
Contributor

izuzak commented Mar 2, 2015

This seems to be a problem with marked (which this project uses for Markdown parsing and rendering to HTML):

$ pbpaste
1. first

  ```
  left
    indent
  ```

  1. sasasa

    ```
    left
      indent
    ```

2. second

$ pbpaste | marked
<ol>
<li><p>first</p>
<pre><code>left
 indent
</code></pre><ol>
<li><p>sasasa</p>
<pre><code>left
indent
</code></pre></li>
</ol>
</li>
<li><p>second</p>
</li>
</ol>

@izuzak izuzak added the blocked label Mar 2, 2015
@chemoish
Copy link

chemoish commented Jun 5, 2015

👍

I noticed that you can remove indentation from content to fix the alignment some of the time.

But doing this is bad as some times the code totally formats incorrectly... And other times the code block breaks entirely.

@izuzak Should I file a bug with marked?

Also, funny that https://github.com/travs/markdown-pdf doesn't carry over the alignment issues. File is created as expected.

@izuzak
Copy link
Contributor

izuzak commented Jun 8, 2015

Should I file a bug with marked?

@chemoish I'd recommend opening an issue if 1) you can still reproduce the problem with marked (perhaps on a smaller example), and 2) the issue isn't already reported on marked. Does that make sense?

@chemoish
Copy link

chemoish commented Jun 9, 2015

markedjs/marked#584

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants