[HepData-svn] r1876 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Jun 22 12:34:54 BST 2015


Author: watt
Date: Mon Jun 22 12:34:53 2015
New Revision: 1876

Log:
Revert to single-quote marks around resource file descriptions, but escape any single-quote marks occurring in the description

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java	Fri Jun 19 17:45:36 2015	(r1875)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/YamlFormatter.java	Mon Jun 22 12:34:53 2015	(r1876)
@@ -99,10 +99,10 @@
         if(p.getReferences().size()>0){
             for (Reference r : p.getReferences()){
                 if(r.getDescription().startsWith("http")){
-                    s.append(sp+"{location: '"+r.getDescription()+"', description: \"experiment TWiki page for analysis\"}\n");
+                    s.append(sp+"{location: '"+r.getDescription()+"', description: 'experiment TWiki page for analysis'}\n");
                 }
             }
-            if (p.getHaveRivet()) { s.append(sp+"{location: 'http://rivet.hepforge.org/analyses#"+p.getRivetName()+"', description: \"Rivet analysis\"}\n"); }
+            if (p.getHaveRivet()) { s.append(sp+"{location: 'http://rivet.hepforge.org/analyses#"+p.getRivetName()+"', description: 'Rivet analysis'}\n"); }
         }
 
 	// here we deal with the extra resource are description/line files
@@ -133,7 +133,7 @@
                         link="http://hepdata.cedar.ac.uk"+in.readLine();	    
                     } 
                     catch (IOException e){}
-		    s.append(sp+"{location: '"+link+"', description: \""+desc+"\"}\n");
+		    s.append(sp+"{location: '"+link+"', description: '"+desc.replaceAll("'","''")+"'}\n");
                 } 
             }
         }
@@ -144,7 +144,7 @@
 	    File testinsert = new File(insertfile);
 	    String insert="";
 	    if(testinsert.exists()){
-		s.append(sp+"{location: 'http://hepdata.cedar.ac.uk/resource/"+ids[j]+"/insert.html', description: \"insert.html\"}\n");
+		s.append(sp+"{location: 'http://hepdata.cedar.ac.uk/resource/"+ids[j]+"/insert.html', description: 'insert.html'}\n");
 	    }
 	}
 


More information about the HepData-svn mailing list