Skip to content

Commit 5b8aa97

Browse files
committed
#5234 Fix spaces in createAnnotatioh() function link text
1 parent 72af1d0 commit 5b8aa97

File tree

2 files changed

+70
-13
lines changed

2 files changed

+70
-13
lines changed

stroom-core-client-widget/src/main/java/stroom/hyperlink/client/Hyperlink.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static Hyperlink create(final String value, final int pos) {
8080
}
8181
final String target = nextToken(value, index, '<', '>');
8282
hyperlink = new Builder()
83-
.text(text)
83+
.text(decode(text))
8484
.href(decode(href))
8585
.type(type)
8686
.target(target)
@@ -125,20 +125,9 @@ private static String nextToken(final String value,
125125
return null;
126126
}
127127

128-
// private static void throwException(final String value,
129-
// final int pos,
130-
// final char startChar,
131-
// final char endChar) throws MalformedLinkException {
132-
// throw new MalformedLinkException("Invalid required token in value '" + value
133-
// + "', pos: " + pos
134-
// + ", startChar: '" + startChar
135-
// + "' endChar: '" + endChar + "'");
136-
// }
137-
138128
public String getText() {
139129
// Why are we decoding the plain text part?
140130
return text;
141-
// return text;
142131
}
143132

144133
public String getHref() {
@@ -213,7 +202,7 @@ public String toString() {
213202
final StringBuilder sb = new StringBuilder();
214203
if (text != null) {
215204
sb.append("[");
216-
sb.append(text);
205+
sb.append(encode(text));
217206
sb.append("]");
218207
}
219208
if (href != null) {
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
* Bug **#5234** : Fix spaces in `createAnnotatioh()` function link text.
2+
3+
4+
```sh
5+
# ********************************************************************************
6+
# Issue number: 5234
7+
# Issue title: createAnnotation() converts spaces to `+` for the text parameter
8+
# Issue tags: f:Annotations, p:high
9+
# Issue link: https://github.com/gchq/stroom/issues/5234
10+
# ********************************************************************************
11+
12+
# ONLY the top line will be included as a change entry in the CHANGELOG.
13+
# The entry should be in GitHub flavour markdown and should be written on a SINGLE
14+
# line with no hard breaks. You can have multiple change files for a single GitHub issue.
15+
# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than
16+
# 'Fixed nasty bug'.
17+
#
18+
# Examples of acceptable entries are:
19+
#
20+
#
21+
# * Bug **#123** : Fix bug with an associated GitHub issue in this repository.
22+
#
23+
# * Bug **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository.
24+
#
25+
# * Feature **#789** : Add new feature X.
26+
#
27+
# * Bug : Fix bug with no associated GitHub issue.
28+
#
29+
#
30+
# Note: The line must start '* XXX ', where 'XXX' is a valid category,
31+
# one of [Bug Feature Refactor Dependency Build].
32+
33+
34+
# --------------------------------------------------------------------------------
35+
# The following is random text to make this file unique for git's change detection
36+
# HUEdjqogF0mcjLfAZjwJrsLO4y8m81ARhUrdJfhLwTAbVjKCRyijR6FE5ZNQHfstllHB253FwBRakRYD
37+
# dqYrxmrH8NAsIIYymuztsQ9f62rnT3BNgNmGFd2BYGEYjt7YyUmGu0Eg1VUuln7x6d2HM6rC7j19gk74
38+
# VmH4xN8YzPDsx38fL7uUb8jjoFTJx05C5sUx7NZZpNn3RGFJR96aY5fCpI32yEmKxKTgqfZ6hdg99kHT
39+
# JluLCE6dDa9lrojss2Bnn1KDU1nwTEIflK3QxUZfc1sRr2OU5KVjxmGELCN2N9rdZFDKCfoKxZVLzMXB
40+
# sqAhSWj2NJPzAfTzMgtaKdH6GSnhPMhZyQ2P2zY5YLoMzdXzZKqxGkQLDFKInsfPgtIENTigoHXCkVtr
41+
# sZcSl1dubUwnPYpdfE4tjgMT5JabElLqBi3jM0oDJNNYToVAa6RWsMMIOMp5cPzzkXxtXI4UGIwqKJYH
42+
# 49X3vMvijMosMnz7G0fcjI6WDalBAhubFgmoT6sxFMiChazWc3akjZVZvfbcdo4ITP5GaK4m0zMiaQSh
43+
# jVy0ZfnNB3sPXDx79AiSYbkCKRaKESyTYvHrwoKjAgLlTYOQ5kTXAqEeaVhBManEigdjTYHQmWind6xK
44+
# rz9qkr8ahs7r9pxQ9RGavfzIvP8UdACx4bRawXlXanWhyJ7OHOVe5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DfN2LcyCinvQ7xeRPfbuhDlaGqKppC8uOgFTqzrZPMg9DcuXJsfOZBqGu4UTtiq
58+
# 7nh9zTTXYWuyXf1AmroFE91c11ZZ4P31wqqSWmvee871vE335OhL9KsoNcgGwzjZvtLwma5QVP0xsQ7A
59+
# KLgnZHjSpm5my4MxXVkAwzdeW7sEuoU0ujIERHEymjn1kJA10VxW3YUdMRvhRpTvw6ijumEFGcqjfFje
60+
# 8o5JpkGEDxPVy5mC4YhUdYSLPn7GCZdh42rQQUDIsL6LoyJGe4YD6x1gFJRiJMM8VJHbqf0GhnjLQv4n
61+
# 73g5OO7APIDsG7f9PgyCPRgrUcnu7EaOYkZjHl3G3Hpu8U65qzikpJPEyMlMtZGp5V5CSZdvTO8koXoF
62+
# k3HEGxGBIbrsrsfj3OGtPbV1pj0cxT2b0DVEwIkgUPko73YQRkmTFA6b6cj1sIE0XKAzB7VtSBz4M4ca
63+
# IDUVQWGr84CBm6jPAxJiTtDGvlOVZll7kCrziMOpsYqgPbR52qrwXv6wOHpQoIBgpM5ukAmOH3Mw4GVV
64+
# aCjgmrY2X2mwXC3uPUb4ZPG4EFwYFhUZJYzmgFPIvevCaghX0taeyzbSuCcedrP0u88JCBDTrUEtMPzM
65+
# Jy2dS9RJMQcsozEz8S6H5x7jInkX62ptLIKKFhZEUBIPboq6KLg7UZGHQuwR1cNS4cxPgIzcl9Z8sGCY
66+
# --------------------------------------------------------------------------------
67+
68+
```

0 commit comments

Comments
 (0)