Detect <p> as richtext paragraph
This commit is contained in:
parent
aa8dd75e5e
commit
e5279dacde
2 changed files with 6 additions and 1 deletions
|
@ -158,7 +158,7 @@ module RichText
|
|||
end
|
||||
|
||||
def paragraph?(element)
|
||||
element.type == :p
|
||||
element.type == :p || (element.type == :html_element && element.value == "p")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -350,6 +350,11 @@ class RichTextTest < ActiveSupport::TestCase
|
|||
assert_equal "Something important here.", r.description
|
||||
end
|
||||
|
||||
def test_markdown_html_description
|
||||
r = RichText.new("markdown", "<p>Can use HTML tags.</p>")
|
||||
assert_equal "Can use HTML tags.", r.description
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_html(richtext, &block)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue