Revision: 22246
          http://sourceforge.net/p/bibdesk/svn/22246
Author:   hofman
Date:     2018-05-17 13:47:31 +0000 (Thu, 17 May 2018)
Log Message:
-----------
remove attribute name and quotes

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

Modified: trunk/bibdesk/BDSKCOinSParser.m
===================================================================
--- trunk/bibdesk/BDSKCOinSParser.m     2018-05-17 06:30:32 UTC (rev 22245)
+++ trunk/bibdesk/BDSKCOinSParser.m     2018-05-17 13:47:31 UTC (rev 22246)
@@ -95,6 +95,11 @@
 // Converts a COins String to a BibItem. All sorts of heuristics and attempts 
to interpret the format in there. 
 + (BibItem *) parseCOinSString: (NSString *) COinSString {
        NSString * inputString = COinSString;
+    
+    // the XMLString adds the attribute name
+    if ([inputString hasCaseInsensitivePrefix:@"title=\""] && [inputString 
hasSuffix:@"\""])
+        inputString = [inputString substringWithRange:NSMakeRange(7, 
[inputString length] - 8)];
+    
        if ([inputString rangeOfString:@"%20"].location == NSNotFound) {
                // COinS has a laughable 'specification' but even that is quite 
clear about spaces being percent escaped to %20. It seems microformat geeks 
seem to be even lazier/stupider than the people who failed to write an actual 
spec and suffer from the misconception that 'URL Encoding' is the same as 
'Percent Escaping', leading to + being used for a space on many sites. To 
minimise the impact of that, replace all + by spaces if no occurrences of %20 
are found.
                inputString = [inputString 
stringByReplacingOccurrencesOfString:@"+" withString:@" "];

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to