aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/util
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2019-10-18 16:11:00 +0200
committerMarvin W <git@larma.de>2019-10-18 16:11:00 +0200
commitde3af0ae24b70ccb7670fa236076c061316f03cb (patch)
treeed721af2bde9bbdcd939b58252cf7b9b2d3f17df /main/src/ui/util
parentfcec78ce27b23ba06b3e9439e04ddff7ee64f806 (diff)
downloaddino-de3af0ae24b70ccb7670fa236076c061316f03cb.tar.gz
dino-de3af0ae24b70ccb7670fa236076c061316f03cb.zip
Fix some incorrect handling of message styling
Diffstat (limited to 'main/src/ui/util')
-rw-r--r--main/src/ui/util/helper.vala8
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index 4e5fbb41..521a0089 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -211,15 +211,15 @@ public static string parse_add_markup(string s_, string? highlight_word, bool pa
for (int i = 0; i < markup_string.length; i++) {
string markup_esc = Regex.escape_string(markup_string[i]);
try {
- Regex regex = new Regex("(^|\\s)" + markup_esc + "(\\S.*?\\S|\\S)" + markup_esc + "($|\\s)");
+ Regex regex = new Regex("(^|\\s)" + markup_esc + "(\\S.*?\\S|\\S)" + markup_esc);
MatchInfo match_info;
regex.match(s.down(), 0, out match_info);
if (match_info.matches()) {
int start, end;
match_info.fetch_pos(2, out start, out end);
- return parse_add_markup(s[0:start], highlight_word, parse_links, parse_text_markup, already_escaped) +
- @"<$(convenience_tag[i])>" + s[start:end] + @"</$(convenience_tag[i])>" +
- parse_add_markup(s[end:s.length], highlight_word, parse_links, parse_text_markup, already_escaped);
+ return parse_add_markup(s[0:start-1], highlight_word, parse_links, parse_text_markup, already_escaped) +
+ s[start-1:start] + @"<$(convenience_tag[i])>" + s[start:end] + @"</$(convenience_tag[i])>" + s[end:end+1] +
+ parse_add_markup(s[end+1:s.length], highlight_word, parse_links, parse_text_markup, already_escaped);
}
} catch (RegexError e) {
assert_not_reached();