Add PQ (pullquote) type

This appears for something like medium's "top highlight". It's like a
blockquote but bigger
This commit is contained in:
Edward Loveall 2021-08-08 18:17:46 -04:00
parent e64e9f0853
commit bf43c7f467
No known key found for this signature in database
GPG Key ID: 789A4AE983AC8901
3 changed files with 16 additions and 1 deletions

View File

@ -244,6 +244,15 @@ describe ParagraphConverter do
"layout": null, "layout": null,
"metadata": null "metadata": null
}, },
{
"text": "text",
"type": "PQ",
"markups": [],
"href": null,
"iframe": null,
"layout": null,
"metadata": null
},
{ {
"text": "text", "text": "text",
"type": "ULI", "type": "ULI",
@ -295,7 +304,8 @@ describe ParagraphConverter do
Heading4.new([Text.new("text")] of Child), Heading4.new([Text.new("text")] of Child),
Paragraph.new([Text.new("text")] of Child), Paragraph.new([Text.new("text")] of Child),
Preformatted.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), UnorderedList.new([ListItem.new([Text.new("text")] of Child)] of Child),
OrderedList.new([ListItem.new([Text.new("text")] of Child)] of Child), OrderedList.new([ListItem.new([Text.new("text")] of Child)] of Child),
Figure.new(children: [ Figure.new(children: [

View File

@ -35,6 +35,10 @@ class ParagraphConverter
paragraph = paragraphs.shift paragraph = paragraphs.shift
children = MarkupConverter.convert(paragraph.text, paragraph.markups) children = MarkupConverter.convert(paragraph.text, paragraph.markups)
node = Paragraph.new(children: children) 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 when PostResponse::ParagraphType::PRE
paragraph = paragraphs.shift paragraph = paragraphs.shift
children = MarkupConverter.convert(paragraph.text, paragraph.markups) children = MarkupConverter.convert(paragraph.text, paragraph.markups)

View File

@ -47,6 +47,7 @@ class PostResponse
IMG IMG
OLI OLI
P P
PQ
PRE PRE
ULI ULI
end end