diff --git a/spec/classes/paragraph_converter_spec.cr b/spec/classes/paragraph_converter_spec.cr index 45ea604..67f1046 100644 --- a/spec/classes/paragraph_converter_spec.cr +++ b/spec/classes/paragraph_converter_spec.cr @@ -244,6 +244,15 @@ describe ParagraphConverter do "layout": null, "metadata": null }, + { + "text": "text", + "type": "PQ", + "markups": [], + "href": null, + "iframe": null, + "layout": null, + "metadata": null + }, { "text": "text", "type": "ULI", @@ -295,7 +304,8 @@ describe ParagraphConverter do Heading4.new([Text.new("text")] of Child), Paragraph.new([Text.new("text")] of Child), Preformatted.new([Text.new("text")] of Child), - BlockQuote.new([Text.new("text")] of Child), + BlockQuote.new([Text.new("text")] of Child), # BQ + BlockQuote.new([Text.new("text")] of Child), # PQ UnorderedList.new([ListItem.new([Text.new("text")] of Child)] of Child), OrderedList.new([ListItem.new([Text.new("text")] of Child)] of Child), Figure.new(children: [ diff --git a/src/classes/paragraph_converter.cr b/src/classes/paragraph_converter.cr index 8c6d7f9..e21343a 100644 --- a/src/classes/paragraph_converter.cr +++ b/src/classes/paragraph_converter.cr @@ -35,6 +35,10 @@ class ParagraphConverter paragraph = paragraphs.shift children = MarkupConverter.convert(paragraph.text, paragraph.markups) node = Paragraph.new(children: children) + when PostResponse::ParagraphType::PQ + paragraph = paragraphs.shift + children = MarkupConverter.convert(paragraph.text, paragraph.markups) + node = BlockQuote.new(children: children) when PostResponse::ParagraphType::PRE paragraph = paragraphs.shift children = MarkupConverter.convert(paragraph.text, paragraph.markups) diff --git a/src/models/post_response.cr b/src/models/post_response.cr index d006ebd..51506cf 100644 --- a/src/models/post_response.cr +++ b/src/models/post_response.cr @@ -47,6 +47,7 @@ class PostResponse IMG OLI P + PQ PRE ULI end