Band-aid fix for bulleted list rendering (#1803)
This commit is contained in:
@@ -109,7 +109,11 @@ class DText
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
html += "<li>#{content}</li>"
|
if nest > 0
|
||||||
|
html += "<li>#{content}</li>"
|
||||||
|
else
|
||||||
|
html += "<p>#{content}</p>"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
while layout.any?
|
while layout.any?
|
||||||
@@ -187,7 +191,7 @@ class DText
|
|||||||
else
|
else
|
||||||
""
|
""
|
||||||
end
|
end
|
||||||
|
|
||||||
when /\[code\](?!\])/
|
when /\[code\](?!\])/
|
||||||
flags[:code] = true
|
flags[:code] = true
|
||||||
'<pre>'
|
'<pre>'
|
||||||
@@ -208,7 +212,7 @@ class DText
|
|||||||
if stack.last == "expandable"
|
if stack.last == "expandable"
|
||||||
stack.pop
|
stack.pop
|
||||||
'</div></div>'
|
'</div></div>'
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
if flags[:code]
|
if flags[:code]
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class DTextTest < ActiveSupport::TestCase
|
|||||||
def test_auto_urls_in_parentheses
|
def test_auto_urls_in_parentheses
|
||||||
assert_equal('<p>a (<a href="http://test.com">http://test.com</a>) b</p>', p('a (http://test.com) b'))
|
assert_equal('<p>a (<a href="http://test.com">http://test.com</a>) b</p>', p('a (http://test.com) b'))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_old_syle_links
|
def test_old_syle_links
|
||||||
assert_equal('<p><a href="http://test.com">test</a></p>', p('"test":http://test.com'))
|
assert_equal('<p><a href="http://test.com">test</a></p>', p('"test":http://test.com'))
|
||||||
end
|
end
|
||||||
@@ -125,6 +125,10 @@ class DTextTest < ActiveSupport::TestCase
|
|||||||
assert_equal('<ul><li><a href="/posts/1">post #1</a></li></ul>', p("* post #1").gsub(/\n/, ""))
|
assert_equal('<ul><li><a href="/posts/1">post #1</a></li></ul>', p("* post #1").gsub(/\n/, ""))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_lists_not_preceded_by_newline
|
||||||
|
assert_equal('<p>a</p><ul><li>b</li><li>c</li></ul>', p("a\n* b\n* c").gsub(/\n/, ""))
|
||||||
|
end
|
||||||
|
|
||||||
def test_inline_tags
|
def test_inline_tags
|
||||||
assert_equal('<p><a href="/posts?tags=tag">tag</a></p>', p("{{tag}}"))
|
assert_equal('<p><a href="/posts?tags=tag">tag</a></p>', p("{{tag}}"))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user