aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-10-11 13:45:54 +0200
committerfiaxh <git@lightrise.org>2020-10-11 13:45:54 +0200
commite0d81f98e306445f676823a61a3c6601da62ee3b (patch)
tree1f33b2fdbccadf440f616f20da5632f5a3e46d1b
parent78138bf39b2da8e11983f4c4e36e808ec9ebeda4 (diff)
downloaddino-e0d81f98e306445f676823a61a3c6601da62ee3b.tar.gz
dino-e0d81f98e306445f676823a61a3c6601da62ee3b.zip
Remove code block formating
-rw-r--r--main/src/ui/util/helper.vala20
1 files changed, 0 insertions, 20 deletions
diff --git a/main/src/ui/util/helper.vala b/main/src/ui/util/helper.vala
index ca2c37d9..888dc66e 100644
--- a/main/src/ui/util/helper.vala
+++ b/main/src/ui/util/helper.vala
@@ -272,13 +272,6 @@ public static Regex get_url_regex() {
return URL_REGEX;
}
-public static Regex get_code_block_regex() {
- if (CODE_BLOCK_REGEX == null) {
- CODE_BLOCK_REGEX = /(?:^|\n)(```([^\n]*)\n(?:[^\n]|\n[^`]|\n`[^`]|\n``[^`]|\n```[^\n])+\n```)(?:\n|$)/s;
- }
- return CODE_BLOCK_REGEX;
-}
-
public static Map<unichar, unichar> get_matching_chars() {
if (MATCHING_CHARS == null) {
MATCHING_CHARS = new HashMap<unichar, unichar>();
@@ -364,19 +357,6 @@ public static string parse_add_markup(string s_, string? highlight_word, bool pa
}
if (parse_text_markup) {
- // Try to match preformatted code blocks first
- MatchInfo code_block_match_info;
- get_code_block_regex().match(s.down().strip(), 0, out code_block_match_info);
- if (code_block_match_info.matches()) {
- int start, end;
- code_block_match_info.fetch_pos(1, out start, out end);
- return parse_add_markup(s[0:start], highlight_word, parse_links, parse_text_markup, already_escaped) +
- "<tt>" +
- s[start:end] +
- "</tt>" +
- parse_add_markup(s[end:s.length], highlight_word, parse_links, parse_text_markup, already_escaped);
- }
-
string[] markup_string = new string[]{"`", "_", "*", "~"};
string[] convenience_tag = new string[]{"tt", "i", "b", "s"};