Skip to content

Commit

Permalink
Use double quotes in html_renderer.cr, begin_code (crystal-lang#5701)
Browse files Browse the repository at this point in the history
* Use double quotes in html_renderer.cr, begin_code

It should use double quotes there instead of apostrophes. Because thats generating bad html code.
For example this is what glitch.com (glitch is an online html editor) says to an markdown crystal code block:
https://imgur.com/a/6nUKz
And other sources say too that double quotes are better.

* Update markdown_spec.cr

* Update markdown_spec.cr

* Update markdown_spec.cr
  • Loading branch information
wooster0 authored and RX14 committed Feb 13, 2018
1 parent b30a9cc commit 5d2fa25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/std/markdown/markdown_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe Markdown do
assert_render " Hello\n World", "<pre><code>Hello</code></pre>\n\n<p>World</p>"
assert_render " Hello\n\n\nWorld", "<pre><code>Hello</code></pre>\n\n<p>World</p>"

assert_render "```crystal\nHello\nWorld\n```", "<pre><code class='language-crystal'>Hello\nWorld</code></pre>"
assert_render "```crystal\nHello\nWorld\n```", %(<pre><code class="language-crystal">Hello\nWorld</code></pre>)
assert_render "Hello\n```\nWorld\n```", "<p>Hello</p>\n\n<pre><code>World</code></pre>"
assert_render "```\n---\n```", "<pre><code>---</code></pre>"

Expand Down
2 changes: 1 addition & 1 deletion src/markdown/html_renderer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Markdown::HTMLRenderer
if language.nil?
@io << "<pre><code>"
else
@io << "<pre><code class='language-#{language}'>"
@io << %(<pre><code class="language-#{language}">)
end
end

Expand Down

0 comments on commit 5d2fa25

Please sign in to comment.