Skip to content
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

Markdown parser mangles codeblocks placed immediately after a list #3772

Closed
Sija opened this issue Dec 24, 2016 · 1 comment
Closed

Markdown parser mangles codeblocks placed immediately after a list #3772

Sija opened this issue Dec 24, 2016 · 1 comment

Comments

@Sija
Copy link
Contributor

Sija commented Dec 24, 2016

Failing test showing buggy behaviour:

diff --git a/spec/std/markdown/markdown_spec.cr b/spec/std/markdown/markdown_spec.cr
index 33fea905e..270ea324f 100644
--- a/spec/std/markdown/markdown_spec.cr
+++ b/spec/std/markdown/markdown_spec.cr
@@ -79,6 +79,7 @@ describe Markdown do
   assert_render "* Level1\n  * Level2\n  * Level2", "<ul><li>Level1</li><ul><li>Level2</li><li>Level2</li></ul></ul>"
   assert_render "* Hello\nWorld", "<ul><li>Hello\nWorld</li></ul>"
   assert_render "Params:\n* Foo\n* Bar", "<p>Params:</p>\n\n<ul><li>Foo</li><li>Bar</li></ul>"
+  assert_render "* Hello\n* World\n\n```\nHello World\n```", "<ul><li>Hello</li><li>World</li></ul>\n\n<pre><code>Hello World</code></pre>"

   assert_render "+ Hello", "<ul><li>Hello</li></ul>"
   assert_render "- Hello", "<ul><li>Hello</li></ul>"

Running crystal spec spec/std/markdown/markdown_spec.cr results in:

Failures:

  1) Markdown renders "* Hello\n* World\n\n```\nHello World\n```"
     Failure/Error: assert_render "* Hello\n* World\n\n```\nHello World\n```", "<ul><li>Hello</li><li>World</li></ul>\n\n<pre><code>Hello World</code></pre>"

       expected: "<ul><li>Hello</li><li>World</li></ul>\n\n<pre><code>Hello World</code></pre>"
            got: "<ul><li>Hello</li><li>World</li></ul>\n\n<pre><code class='language-Hello World'>```</code></pre>"

     # spec/std/markdown/markdown_spec.cr:82

This issue has been filled as a followup to #3759 (comment).

Sija added a commit to Sija/crystal that referenced this issue Dec 24, 2016
@Sija Sija mentioned this issue Dec 24, 2016
Sija added a commit to Sija/crystal that referenced this issue Dec 26, 2016
@asterite asterite added this to the 0.20.4 milestone Dec 26, 2016
asterite pushed a commit that referenced this issue Dec 26, 2016
@Sija
Copy link
Contributor Author

Sija commented Dec 26, 2016

Fixed in 7e9be8a

@Sija Sija closed this as completed Dec 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants