Skip to content

Commit

Permalink
Added underline annotation support
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Aug 28, 2024
1 parent a089dba commit 361c70a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Zotero/Models/FieldKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct FieldKeys {

static func allHtmlEpubFields(for type: AnnotationType) -> [KeyBaseKeyPair] {
switch type {
case .highlight:
case .highlight, .underline:
return [KeyBaseKeyPair(key: Annotation.type, baseKey: nil),
KeyBaseKeyPair(key: Annotation.comment, baseKey: nil),
KeyBaseKeyPair(key: Annotation.color, baseKey: nil),
Expand All @@ -172,7 +172,7 @@ struct FieldKeys {
KeyBaseKeyPair(key: Annotation.Position.htmlEpubType, baseKey: Annotation.position),
KeyBaseKeyPair(key: Annotation.Position.htmlEpubValue, baseKey: Annotation.position)]

case .ink, .image, .underline, .freeText:
case .ink, .image, .freeText:
return []
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ class HtmlEpubDocumentViewController: UIViewController {
case .note:
toolName = "note"

case .eraser, .image, .ink, .underline, .freeText:
case .underline:
toolName = "underline"

case .eraser, .image, .ink, .freeText:
return
}
webViewHandler.call(javascript: "setTool({ type: '\(toolName)', color: '\(color.hexString)' });").subscribe().disposed(by: disposeBag)
Expand Down

0 comments on commit 361c70a

Please sign in to comment.