Revision: 28952 http://sourceforge.net/p/bibdesk/svn/28952 Author: hofman Date: 2024-10-04 16:49:55 +0000 (Fri, 04 Oct 2024) Log Message: ----------- biblatex aux cite command has an extra argument, so scan that first to get to the cite key
Modified Paths: -------------- trunk/bibdesk/BibDocument_DataSource.m Modified: trunk/bibdesk/BibDocument_DataSource.m =================================================================== --- trunk/bibdesk/BibDocument_DataSource.m 2024-09-27 17:01:12 UTC (rev 28951) +++ trunk/bibdesk/BibDocument_DataSource.m 2024-10-04 16:49:55 UTC (rev 28952) @@ -674,10 +674,13 @@ - (BOOL)selectItemsInAuxFileURL:(NSURL *)auxURL { NSString *auxString = [NSString stringWithContentsOfURL:auxURL guessedEncoding:[self documentStringEncoding]]; NSString *command = @"\\bibcite{"; // we used to get the command by looking at the line after \bibdata, but that's unreliable as there can be other stuff in between the \bibcite commands - + NSString *altCommand = nil; + if (auxString == nil) return NO; + BOOL isBiblatex = NO; + if ([auxString rangeOfString:command].length == 0) { // if there are no \bibcite commands we'll use the cite's, which are usualy added as \citation commands to the .aux file command = @"\\citation{"; @@ -684,8 +687,9 @@ if ([auxString rangeOfString:command].length == 0) { // biblatex uses the following comman command = @"\\abx@aux@cite{"; - if ([auxString rangeOfString:command].length == 0) + if ([auxString rangeOfString:command].length == 0 && [auxString rangeOfString:@"\\abx@aux@cite["].length == 0) return NO; + isBiblatex = YES; } } @@ -698,6 +702,7 @@ do { if ([scanner scanString:command intoString:NULL] && + (isBiblatex == NO || (([scanner scanUpToString:@"}" intoString:NULL] || YES) && [scanner scanString:@"}{" intoString:NULL])) && [scanner scanUpToString:@"}" intoString:&keys]) { for (NSString *key in [keys componentsSeparatedByString:@","]) { if ((items = [publications allItemsForCiteKey:key])) 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