Revision: 28829
          http://sourceforge.net/p/bibdesk/svn/28829
Author:   hofman
Date:     2024-03-05 10:39:31 +0000 (Tue, 05 Mar 2024)
Log Message:
-----------
clean page range in refer string

Modified Paths:
--------------
    trunk/bibdesk/BibItem.m

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2024-03-05 10:16:56 UTC (rev 28828)
+++ trunk/bibdesk/BibItem.m     2024-03-05 10:39:31 UTC (rev 28829)
@@ -2013,7 +2013,7 @@
     
     for (NSString *k in keys) {
         tag = [btm referTagForBibTeXFieldName:k];
-        // ignore fields that have no RIS tag, we should not contruct invalid 
or wrong RIS
+        // ignore fields that have no refer tag, we should not contruct 
invalid or wrong refer
         if (tag == nil) continue;
         
         v = [self valueOfField:k];
@@ -2028,6 +2028,14 @@
             a = [self groupArrayForField:k];
             for (v in a)
                 [s appendFormat:@"%%%@ %@\n", k, v];
+        } else if ([k isEqualToString:BDSKPagesString]) {
+            NSRange r = [v rangeOfString:@" -- "];
+            if (r.length == 0)
+                r = [v rangeOfString:@"-"];
+            if (r.length)
+                [s appendFormat:@"%%%@ %@-%@\n", k, [v 
substringWithRange:NSMakeRange(0, r.location)], [v 
substringFromIndex:NSMaxRange(r)]];
+            else
+                [s appendFormat:@"%%%@ %@\n", k, [v stringByRemovingTeX]];
         } else if (useURLField || [k isEqualToString:BDSKUrlString] == NO) {
             [s appendFormat:@"%%%@ %@\n", k, [v stringByRemovingTeX]];
         }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to