fix nil commentary case for pixiv strategy #3948

This commit is contained in:
Albert Yi
2018-10-12 14:35:44 -07:00
parent 3696fb10a0
commit a85f3773e3

View File

@@ -26,6 +26,10 @@ module Sources
end
def self.to_dtext(text)
if text.nil?
return nil
end
text = text.gsub(%r!https?://www\.pixiv\.net/member_illust\.php\?mode=medium&illust_id=([0-9]+)!i) do |match|
pixiv_id = $1
%(pixiv ##{pixiv_id} "»":[/posts?tags=pixiv:#{pixiv_id}])