Git Product home page Git Product logo

Comments (6)

russross avatar russross commented on June 2, 2024

I don't understand the question. Can you provide a simple test case and how you think it should be rendered?

from blackfriday.

 avatar commented on June 2, 2024

Simply this in test.md:

# Hello

* hi
<pre>
<code>
# hi
fdfkfdl
</code>
</pre>
* ho

Nested pre, code tags with lists.

from blackfriday.

rtfb avatar rtfb commented on June 2, 2024

It works fine if you use the EXTENSION_LAX_HTML_BLOCKS extension:

func TestRepro(t *testing.T) {
    var tests = []string{
        `* hi
<pre>
<code>
# hi
</code>
</pre>
* ho
`,
        `<ul>
<li><p>hi</p>

<pre>
<code>
# hi
</code>
</pre></li>

<li><p>ho</p></li>
</ul>
`,
    }
    doTestsInlineParam(t, tests, Options{
        Extensions: EXTENSION_LAX_HTML_BLOCKS,
    }, 0, HtmlRendererParameters{})
}

Note: if you remove the Extensions: EXTENSION_LAX_HTML_BLOCKS, line, the problem will reproduce just like you described.

from blackfriday.

rtfb avatar rtfb commented on June 2, 2024

Alternatively, this also works correctly, as per description in the original Markdown spec:

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab

func TestRepro(t *testing.T) {
    var tests = []string{
        `*   hi

    <pre>
    <code>
    # hi
    </code>
    </pre>

* ho
`,
        `<ul>
<li><p>hi</p>

<pre>
<code>
# hi
</code>
</pre></li>

<li><p>ho</p></li>
</ul>
`,
    }
    doTestsInlineParam(t, tests, Options{
    //Extensions: EXTENSION_LAX_HTML_BLOCKS,
    }, 0, HtmlRendererParameters{})
}

Note: I have indented "hi" to 4th column, all of the <pre> block to 4th column, and added blank lines around the <pre> block; no extension needed in this case.

I consider the issue closed.

from blackfriday.

piranha avatar piranha commented on June 2, 2024

Hey, so I've tried this thing with EXTENSION_LAX_HTML_BLOCKS and it didn't work for me, # hi was still rendered as a header rather than code.

from blackfriday.

rtfb avatar rtfb commented on June 2, 2024

I just tried the above snippet and with latest code it still works as I described. Can you post yours?

from blackfriday.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.