From: gmungoc Date: Thu, 18 May 2017 14:28:54 +0000 (+0100) Subject: JAL-2543 html-encode quote characters in feature description X-Git-Tag: Release_2_10_3b1~265 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c1c1eaac282c848b02704e819400396fcc685ef5;p=jalview.git JAL-2543 html-encode quote characters in feature description --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 885d79d..0c052d9 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1556,35 +1556,37 @@ public class AlignmentPanel extends GAlignmentPanel implements for (f = 0; f < fSize; f++) { - if ((features[f].getBegin() <= seq.findPosition(res)) - && (features[f].getEnd() >= seq.findPosition(res))) + SequenceFeature sf = features[f]; + if ((sf.getBegin() <= seq.findPosition(res)) + && (sf.getEnd() >= seq.findPosition(res))) { - if (features[f].isContactFeature()) + if (sf.isContactFeature()) { - if (features[f].getBegin() == seq.findPosition(res) - || features[f].getEnd() == seq + if (sf.getBegin() == seq.findPosition(res) + || sf.getEnd() == seq .findPosition(res)) { - text.append("
").append(features[f].getType()) - .append(" ").append(features[f].getBegin()) - .append(":").append(features[f].getEnd()); + text.append("
").append(sf.getType()) + .append(" ").append(sf.getBegin()) + .append(":").append(sf.getEnd()); } } else { text.append("
"); - text.append(features[f].getType()); - if (features[f].getDescription() != null - && !features[f].getType().equals( - features[f].getDescription())) + text.append(sf.getType()); + String description = sf.getDescription(); + if (description != null + && !sf.getType().equals(description)) { - text.append(" ").append(features[f].getDescription()); + description = description.replace("\"", """); + text.append(" ").append(description); } - if (features[f].getValue("status") != null) + String status = sf.getStatus(); + if (status != null && !"".equals(status)) { - text.append(" (").append(features[f].getValue("status")) - .append(")"); + text.append(" (").append(status).append(")"); } } }