aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thogai.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/thogai.el b/thogai.el
index 06db17c..1803405 100644
--- a/thogai.el
+++ b/thogai.el
@@ -255,8 +255,14 @@ External callers should always pass nil as the value."
((pred (lambda (str)
(string-suffix-p "^}" str)))
(thogai-insert-translation
- (concat (string-remove-prefix "{" (string-remove-suffix "^}" translation))
- "{^}")
+ (concat
+ (let ((unwrapped (string-remove-prefix "{" (string-remove-suffix "^}" translation))))
+ ;; If `translation' is a capitalization carry prefix, wrap
+ ;; it up again.
+ (if (string-prefix-p "~|" unwrapped)
+ (concat "{" unwrapped "}")
+ unwrapped))
+ "{^}")
non-first-part-p))
;; Carry capitalization.
((pred (lambda (str)