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 text : String
|
||||
|
||||
def self.convert(text : String, markups : Array(PostResponse::Markup))
|
||||
def self.convert(text : String?, markups : Array(PostResponse::Markup))
|
||||
new(text, markups).convert
|
||||
end
|
||||
|
||||
def initialize(@text : String, @markups : Array(PostResponse::Markup))
|
||||
def initialize(text : String?, @markups : Array(PostResponse::Markup))
|
||||
@text = text || ""
|
||||
end
|
||||
|
||||
def convert : Array(Child)
|
||||
|
|
|
@ -32,7 +32,7 @@ class PostResponse
|
|||
end
|
||||
|
||||
class Paragraph < Base
|
||||
property text : String
|
||||
property text : String?
|
||||
property type : ParagraphType
|
||||
property markups : Array(Markup)
|
||||
property iframe : IFrame?
|
||||
|
|
Loading…
Reference in a new issue