From 7166b7d83421628ad611a01997e9370a989400c1 Mon Sep 17 00:00:00 2001 From: Edward Loveall Date: Wed, 20 Oct 2021 20:39:18 -0400 Subject: [PATCH] Add SECTION_CAPTION paragraph type This doesn't seem to be rendered on medium.com. Here's a post that has one, but the text is nowhere on the page: https://medium.com/message/the-joy-of-typing-fd8d091ab8ef This help articles hints that it might have been a feature at one point that they don't allow anymore: https://medium.com/@Medium/images-652ee60abea6 --- src/classes/paragraph_converter.cr | 5 +++++ src/models/post_response.cr | 1 + 2 files changed, 6 insertions(+) diff --git a/src/classes/paragraph_converter.cr b/src/classes/paragraph_converter.cr index 77ab31c..d62185f 100644 --- a/src/classes/paragraph_converter.cr +++ b/src/classes/paragraph_converter.cr @@ -47,6 +47,11 @@ class ParagraphConverter paragraph = paragraphs.shift children = MarkupConverter.convert(paragraph.text, paragraph.markups) node = Preformatted.new(children: children) + when PostResponse::ParagraphType::SECTION_CAPTION + # unused. just here to catch the type instead of implicitly going to the + # else block + paragraph = paragraphs.shift + node = Empty.new when PostResponse::ParagraphType::ULI list_items = convert_uli(paragraphs) node = UnorderedList.new(children: list_items) diff --git a/src/models/post_response.cr b/src/models/post_response.cr index 99a0931..1088d25 100644 --- a/src/models/post_response.cr +++ b/src/models/post_response.cr @@ -52,6 +52,7 @@ class PostResponse P PQ PRE + SECTION_CAPTION ULI end