From: Anton Khorev Date: Wed, 7 Aug 2024 03:09:38 +0000 (+0300) Subject: Detect

as richtext paragraph X-Git-Tag: live~466^2~6 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e5279dacde1f53db0d94a1bca2ab4ff45ed5ceec Detect

as richtext paragraph --- diff --git a/lib/rich_text.rb b/lib/rich_text.rb index b720f33e7..b0b83cf5a 100644 --- a/lib/rich_text.rb +++ b/lib/rich_text.rb @@ -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 diff --git a/test/lib/rich_text_test.rb b/test/lib/rich_text_test.rb index 3536db398..929abf823 100644 --- a/test/lib/rich_text_test.rb +++ b/test/lib/rich_text_test.rb @@ -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", "

Can use HTML tags.

") + assert_equal "Can use HTML tags.", r.description + end + private def assert_html(richtext, &block)