KeyHandler // Simplify handleCtrlOptionCommandEnter().

This commit is contained in:
ShikiSuen 2022-06-30 20:49:36 +08:00
parent 00f44ffbcb
commit 0d157c2d32
1 changed files with 3 additions and 6 deletions

View File

@ -399,7 +399,7 @@ extension KeyHandler {
for theAnchor in walkedAnchors { for theAnchor in walkedAnchors {
if let node = theAnchor.node { if let node = theAnchor.node {
var key = node.currentKeyValue.key var key = node.key
if mgrPrefs.inlineDumpPinyinInLieuOfZhuyin { if mgrPrefs.inlineDumpPinyinInLieuOfZhuyin {
key = restoreToneOneInZhuyinKey(target: key) // key = restoreToneOneInZhuyinKey(target: key) //
key = Tekkon.cnvPhonaToHanyuPinyin(target: key) // key = Tekkon.cnvPhonaToHanyuPinyin(target: key) //
@ -410,11 +410,8 @@ extension KeyHandler {
} }
let value = node.currentKeyValue.value let value = node.currentKeyValue.value
if key.contains("_") { // //
composed += value composed += key.contains("_") ? value : "<ruby>\(value)<rp>(</rp><rt>\(key)</rt><rp>)</rp></ruby>"
} else {
composed += "<ruby>\(value)<rp>(</rp><rt>\(key)</rt><rp>)</rp></ruby>"
}
} }
} }