Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

--- inside code block destroys formatting #91

Closed
balupton opened this Issue · 7 comments

2 participants

@balupton

Say I have the following markdown:

## The Basics

1. Say you were to create the following website structure:

    > - myWebsite
        - src
            - documents
            - files
            - layouts

1. Install a few plugins:

    ```
    cd myWebsite
    npm install --save docpad-plugin-eco docpad-plugin-marked
    ```

1. Create the following files:

    1. A layout at `src/layouts/default.html.eco` that contains:

        ``` erb
        <html>
        <head><title><%=@document.title%></title></head>
        <body>
            <%-@content%>
        </body>
        </html>
        ```

    2. And another layout at `src/layouts/post.html.eco` that contains:

        ``` erb
        ad
        ---
        layout: default
        ---
        <h1><%=@document.title%></h1>
        <div><%-@content%></div>
        ```

    3. And a document at `src/documents/posts/hello.html.md` that contains:

        ``` html
        ---
        layout: post
        title: Hello World!
        ---
        Hello **World!**
        ```

Unfortunately with marked, that last sublisting will render as:

Image

Changing the --- to something else say === make it work perfectly though... However, we need --- in these code examples!

@chjj
Owner

This is a side effect of marked's strict conformance with the original markdown. The list rule sees those --- as <hr>'s. In the original markdown, a list will stop immediately once it sees a horizontal rule. As you pointed out, this is causing some interference with GFM rules, which the original markdown never had. I'll have to solve this dissonance somehow, maybe by allowing different list behavior in GFM.

Let me see how github does it:

Without code block:

  • item one
  • item two * * * paragraph

With code block:

  • item one
  • item two
* * *
paragraph

Markdown:

* item
one
* item
two
* * *
paragraph

---

With code block:

* item
one
* item
two

paragraph

testing
breaks

@chjj
Owner

Github looks like it has a completely different set of problems with this. Here is the markdown I used above: https://gist.github.com/3930025

@balupton

Yeah. Robotskirt (Sundown) is the only thing that I found that renders it as I would expect.

@chjj
Owner

Are you referring to the markdown I posted above? I think github uses a slightly modified version of libupskirt. Surprising that sundown/robotskirt would render it correctly.

@chjj
Owner

I should have posted earlier. I did fix this a while ago but I'm still kind of unsure about pushing the fix to release. It's still not perfect.

7d89a71

@balupton

Well, please push if possible. As this is the only thing preventing us from moving from robotskirt/sundown to marked. Is there anything you'd like me to do from my end to help get this in?

@chjj chjj closed this in 7d89a71
@balupton

THANK YOU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.