mirror of
https://git.sr.ht/~edwardloveall/scribe
synced 2025-12-10 12:41:23 +00:00
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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user