Browse Source

【fix】【注释】添加超链接的时候,应该禁止粘贴换行

tangchao 4 months ago
parent
commit
b5ffec9fc9

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMAnnotationSelectLinkViewController.swift

@@ -584,7 +584,8 @@ enum KMAnnotationLinkType: UInt {
     @objc func controlTextDidChange(_ notification: Notification) {
         guard let textField = notification.object as? NSTextField else { return }
         
-        let string = textField.stringValue.replacingOccurrences(of: "\n", with: "")
+        var string = textField.stringValue.replacingOccurrences(of: "\n", with: "")
+        string = string.replacingOccurrences(of: "\r", with: "")
         textField.stringValue = string
         if mouseDownBox!.isEqual(linkPageBox) {
             pageRecord = string