more mention progress

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-05-07 13:50:19 -07:00
parent 73652513d9
commit 0eb1372937
21 changed files with 611 additions and 144 deletions

View File

@@ -0,0 +1,31 @@
//
// PostBlock.swift
// damus
//
// Created by William Casarin on 2022-05-07.
//
import Foundation
enum PostBlock {
case text(String)
case ref(ReferencedId)
var is_text: Bool {
if case .text = self {
return true
}
return false
}
var is_ref: Bool {
if case .ref = self {
return true
}
return false
}
}
func parse_post_textblock(str: String, from: Int, to: Int) -> PostBlock {
return .text(String(substring(str, start: from, end: to)))
}