aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorXavi92 <XaviDCR92@users.noreply.github.com>2021-12-30 15:22:03 +0000
committerGitHub <noreply@github.com>2021-12-30 16:22:03 +0100
commit795af2d9cec6c730cdb41bb3fb5449e2b50dbe52 (patch)
tree90565169daafd6dd908d20348788c143e875d169 /main
parent9490ffed6b5a2b17426d3aabcb3d4fa4c8e53625 (diff)
downloaddino-795af2d9cec6c730cdb41bb3fb5449e2b50dbe52.tar.gz
dino-795af2d9cec6c730cdb41bb3fb5449e2b50dbe52.zip
Format quotes as preformatted text (#1111)
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/util/helper.vala13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index d5967ef3..ecfb777d 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -341,6 +341,19 @@ public static string parse_add_markup(string s_, string? highlight_word, bool pa
assert_not_reached();
}
}
+
+ Regex regex = new Regex("((?<=\n)&gt;.*(\n|$))|(^&gt;.*(\n|$))");
+ MatchInfo match_info;
+ regex.match(s.down(), 0, out match_info);
+
+ if (match_info.matches()) {
+ int start, end;
+
+ match_info.fetch_pos(0, out start, out end);
+ return parse_add_markup(s[0:start], highlight_word, parse_links, parse_text_markup, already_escaped) +
+ "<span fgalpha='70%'>" + s[start:end] + "</span>" +
+ parse_add_markup(s[end:s.length], highlight_word, parse_links, parse_text_markup, already_escaped);
+ }
}
return s;