Parsing image escapes and markup will only occur if their respective options are enabled

This commit is contained in:
Scoopta
2019-12-16 19:38:12 -08:00
parent c248461260
commit 8594fc52a3
3 changed files with 28 additions and 11 deletions

View File

@@ -59,12 +59,16 @@ void wofi_dmenu_init(struct map* config) {
void wofi_dmenu_exec(const gchar* cmd) {
char* action = strdup(cmd);
if(parse_action) {
free(action);
action = wofi_parse_image_escapes(cmd);
char* out;
pango_parse_markup(action, -1, 0, NULL, &out, NULL, NULL);
free(action);
action = out;
if(wofi_allow_images()) {
free(action);
action = wofi_parse_image_escapes(cmd);
}
if(wofi_allow_markup()) {
char* out;
pango_parse_markup(action, -1, 0, NULL, &out, NULL, NULL);
free(action);
action = out;
}
}
wofi_write_cache(MODE, cmd);
printf("%s\n", action);