Skip to content

Commit 9b4df6a

Browse files
trim spaces on eventDataNarrative attribute brackets
1 parent e0d7e79 commit 9b4df6a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

snd/src/org/labkey/snd/SNDManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3457,7 +3457,12 @@ private String generateEventDataNarrative(Container c, User u, Event event, Even
34573457
value = "<span class='" + AttributeData.ATTRIBUTE_DATA_CSS_CLASS + "'>" + value + "</span>";
34583458
}
34593459

3460-
eventDataNarrative = new StringBuilder(eventDataNarrative.toString().replace("{" + pd.getName() + "}", value));
3460+
// Trim any spaces immediately inside '{' and '}' to make tokens like "{ route 2}" -> "{route 2}"
3461+
String normalized = eventDataNarrative.toString()
3462+
.replaceAll("\\{\\s+", "{")
3463+
.replaceAll("\\s+\\}", "}");
3464+
3465+
eventDataNarrative = new StringBuilder(normalized.replace("{" + pd.getName() + "}", value));
34613466
}
34623467
}
34633468

0 commit comments

Comments
 (0)