             return
         }
         
-        viewModel.updateOverrideText(overrideTextView.textStorage?.string ?? "")
+        viewModel.updateOverrideText(overrideTextView.textStorage?.removingTokenMarkup.string ?? "")
+    }
+
+    func textView(_ view: NSTextView, writablePasteboardTypesFor cell: NSTextAttachmentCellProtocol, at charIndex: Int) -> [String] {
+        return [NSFileContentsPboardType]
+    }
+    
+    func textView(_ view: NSTextView, write cell: NSTextAttachmentCellProtocol, at charIndex: Int, to pboard: NSPasteboard, type: String) -> Bool {
+        if type == NSFileContentsPboardType, let wrapper = cell.attachment?.fileWrapper {
+            pboard.write(wrapper)
+        }
+        return true
+    }
+
+}
+
+extension EditPanelController: NSTextStorageDelegate {
+    
+    override func textStorageWillProcessEditing(_ notification: Notification) {
+        guard let textStorage = notification.object as? NSTextStorage else {
+            return
+        }
+        
+        textStorage.applyTokenMarkup()
     }
     
 }

        setOverridePluralsVisible(viewModel.showsOverridePlurals)

        let range = NSRange(location: 0, length: (overrideTextView.string ?? "").length)
        overrideTextView.textStorage?.replaceCharacters(in: range, with: viewModel.overrideText)
        overrideRemovePluralRuleButton.isEnabled = viewModel.canRemoveSelectedOverridePluralRule
        
        overridePluralRuleSelector.segmentCount = viewModel.overridePluralRuleNames.count

        translatedTextView.textContainer?.lineFragmentPadding = 0
        
        overrideTextView.textContainerInset = NSSize(width: 0, height: 3)
        overrideTextView.textStorage?.delegate = self
        
        if viewModel != nil {
            updateUI()
