You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require'redcarpet'md=%{this is an **unordered** list:* an item* another itemthis is an **ordered** list:1. first2. secondcoda}renderer=Redcarpet::Markdown.new(Redcarpet::Render::HTML.new)putsrenderer.rendermd
but trim some newlines and use the lax_spacing option and the second list is wrapped in a <p> tag:
update: GitHub also renders the second list in a <p> tag
md=%{this is an **unordered** list:* an item* another itemthis is an **ordered** list:1. first2. secondcoda}renderer=Redcarpet::Markdown.new(Redcarpet::Render::HTML.new,lax_spacing: true)putsrenderer.rendermd=begin<p>this is an <strong>unordered</strong> list:</p><ul><li>an item</li><li>another item</li></ul><p>this is an <strong>ordered</strong> list:1. first2. second</p><p>coda</p>=end
pad the numbered list with leading spaces and it renders OK again, is this how it is supposed to work?
md=%{this is an **unordered** list:* an item* another itemthis is an **ordered** list: 1. first 2. secondcoda}renderer=Redcarpet::Markdown.new(Redcarpet::Render::HTML.new,lax_spacing: true)putsrenderer.rendermd=begin<p>this is an <strong>unordered</strong> list:</p><ul><li>an item</li><li>another item</li></ul><p>this is an <strong>ordered</strong> list:</p><ol><li>first</li><li>second</li></ol><p>coda</p>=end
The text was updated successfully, but these errors were encountered:
Previously, enabling the `:lax_spacing` option, if a paragraph was
followed by an ordered list it was previously unparsed and was part
of the paragraph but this is no more the case.
The fix is pretty straightforward, since the `parse_paragraph` method
was checking through the `isalnum` function whether the first char on
the next line was alpha-numeric but ordered list start with numerics,
we just need to substitute the function with isalpha.
Fixes#311
This renders OK (using v3):
but trim some newlines and use the
lax_spacing
option and the second list is wrapped in a<p>
tag:update: GitHub also renders the second list in a
<p>
tagpad the numbered list with leading spaces and it renders OK again, is this how it is supposed to work?
The text was updated successfully, but these errors were encountered: