Fix ignore_newline regardless of markup

Fix issue where ignore_newline wouldn't work with other markup options. Fixes #293
This commit is contained in:
Eizen 2017-02-08 21:51:24 -03:00
parent 956f91f6a4
commit 3ef15065a3

View File

@ -245,13 +245,7 @@ char *notification_replace_format(const char *needle, const char *replacement,
if (markup_mode == MARKUP_NO) { if (markup_mode == MARKUP_NO) {
tmp = strdup(replacement); tmp = strdup(replacement);
tmp = string_replace_all("\\n", "\n", tmp);
if (settings.ignore_newline) {
tmp = string_replace_all("\n", " ", tmp);
}
tmp = notification_quote_markup(tmp); tmp = notification_quote_markup(tmp);
ret = string_replace_all(needle, tmp, haystack);
free(tmp);
} else { } else {
tmp = strdup(replacement); tmp = strdup(replacement);
if (settings.ignore_newline) { if (settings.ignore_newline) {
@ -269,9 +263,15 @@ char *notification_replace_format(const char *needle, const char *replacement,
tmp = notification_quote_markup(tmp); tmp = notification_quote_markup(tmp);
} }
}
tmp = string_replace_all("\\n", "\n", tmp);
if (settings.ignore_newline) {
tmp = string_replace_all("\n", " ", tmp);
}
ret = string_replace_all(needle, tmp, haystack); ret = string_replace_all(needle, tmp, haystack);
free(tmp); free(tmp);
}
return ret; return ret;
} }