Merge branch 'feature/JAL-3468featureDescriptionEllipsis' into develop
[jalview.git] / src / jalview / io / SequenceAnnotationReport.java
index 1bbc338..2cc0cd5 100644 (file)
@@ -240,9 +240,11 @@ public class SequenceAnnotationReport
 
         /*
          * truncate overlong descriptions unless they contain an href
-         * (as truncation could leave corrupted html)
+         * before the truncation point (as truncation could leave corrupted html)
          */
-        boolean hasLink = description.indexOf("a href") > -1;
+        int linkindex = description.toLowerCase().indexOf("<a ");
+        boolean hasLink = linkindex > -1
+                && linkindex < MAX_DESCRIPTION_LENGTH;
         if (description.length() > MAX_DESCRIPTION_LENGTH && !hasLink)
         {
           description = description.substring(0, MAX_DESCRIPTION_LENGTH)