Support null text on paragraphs
I think this was an old feature on medium, but you can see examples of null text on this post: https://medium.com/message/the-joy-of-typing-fd8d091ab8ef
This commit is contained in:
parent
7166b7d834
commit
5df9c44a5c
2 changed files with 4 additions and 3 deletions
|
@ -12,11 +12,12 @@ class MarkupConverter
|
||||||
getter markups : Array(PostResponse::Markup)
|
getter markups : Array(PostResponse::Markup)
|
||||||
getter text : String
|
getter text : String
|
||||||
|
|
||||||
def self.convert(text : String, markups : Array(PostResponse::Markup))
|
def self.convert(text : String?, markups : Array(PostResponse::Markup))
|
||||||
new(text, markups).convert
|
new(text, markups).convert
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(@text : String, @markups : Array(PostResponse::Markup))
|
def initialize(text : String?, @markups : Array(PostResponse::Markup))
|
||||||
|
@text = text || ""
|
||||||
end
|
end
|
||||||
|
|
||||||
def convert : Array(Child)
|
def convert : Array(Child)
|
||||||
|
|
|
@ -32,7 +32,7 @@ class PostResponse
|
||||||
end
|
end
|
||||||
|
|
||||||
class Paragraph < Base
|
class Paragraph < Base
|
||||||
property text : String
|
property text : String?
|
||||||
property type : ParagraphType
|
property type : ParagraphType
|
||||||
property markups : Array(Markup)
|
property markups : Array(Markup)
|
||||||
property iframe : IFrame?
|
property iframe : IFrame?
|
||||||
|
|
Loading…
Reference in a new issue