JAL-2920 wrap description in <html/> if it includes <br/>
[jalview.git] / src / jalview / ws / dbsources / Uniprot.java
index c311ea9..167cd97 100644 (file)
@@ -309,7 +309,9 @@ public class Uniprot extends DbSourceProxyImpl
     /*
      * append variant in standard format if present
      * e.g. p.Arg59Lys
+     * multiple variants are split over lines using <br>
      */
+    boolean asHtml = false;
     if (orig != null && !orig.isEmpty() && variants != null
             && !variants.isEmpty())
     {
@@ -356,7 +358,8 @@ public class Uniprot extends DbSourceProxyImpl
         }
         if (++p != variants.size())
         {
-          sb.append("\n");
+          sb.append("<br/>&nbsp;&nbsp;");
+          asHtml = true;
         }
         else
         {
@@ -369,6 +372,11 @@ public class Uniprot extends DbSourceProxyImpl
     {
       sb.append(description);
     }
+    if (asHtml)
+    {
+      sb.insert(0, "<html>");
+      sb.append("</html>");
+    }
 
     return sb.toString();
   }