import UIKit // MARK: - 自定义富文本属性键 /// EPUBTextRendering 层使用的自定义 NSAttributedString 属性键。 /// 这些属性由 `RDEPUBTextRendererSupport` 在渲染阶段注入, /// 供 `RDEPUBTextLayouter` 分页时读取语义信息。 public extension NSAttributedString.Key { /// 块级元素在富文本中的字符范围(NSString 编码的 NSRange) static let rdPageBlockRange = NSAttributedString.Key("com.rdreader.epub.pageBlockRange") /// 块级元素在章节中的序号 static let rdPageBlockIndex = NSAttributedString.Key("com.rdreader.epub.pageBlockIndex") /// fragment 锚点 ID static let rdPageFragmentID = NSAttributedString.Key("com.rdreader.epub.pageFragmentID") /// 附件类型(图片/通用附件) static let rdPageAttachmentKind = NSAttributedString.Key("com.rdreader.epub.pageAttachmentKind") /// 块级元素类型(段落/列表/表格/代码等) static let rdPageBlockKind = NSAttributedString.Key("com.rdreader.epub.pageBlockKind") /// 语义提示标记(避免分页、保持与下一段同页等,逗号分隔) static let rdPageSemanticHints = NSAttributedString.Key("com.rdreader.epub.pageSemanticHints") /// 附件布局方式(行内/基线/居中) static let rdPageAttachmentPlacement = NSAttributedString.Key("com.rdreader.epub.pageAttachmentPlacement") } // MARK: - 块级元素类型枚举 /// HTML 块级元素的类型分类,用于分页时判断语义边界。 public enum RDEPUBTextBlockKind: String, Codable, Equatable, CaseIterable { case paragraph //

case list //