Updated load_html function of webkit to version 2

This commit is contained in:
Markus Koch 2017-03-12 18:00:44 +01:00
parent aa8a9a003b
commit b0b6a553b7

View File

@ -708,16 +708,16 @@ static void mainWindow_set_text(struct mainWindow *mainWindow, gchar *text, gcha
cmd = g_strdup_printf("markdown %s", tempfile_path);
if (g_spawn_command_line_sync(cmd, &cmd_stdout, &cmd_stderr, &exit_status, NULL) &&
exit_status == 0) {
webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(mainWindow->webkitView),
webkit_web_view_load_html(WEBKIT_WEB_VIEW(mainWindow->webkitView),
cmd_stdout, base_url);
} else {
g_warning("Could not render markdown for file. Showing plain text instead.\n");
webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(mainWindow->webkitView),
webkit_web_view_load_html(WEBKIT_WEB_VIEW(mainWindow->webkitView),
text, base_url);
}
g_free(base_url);
} else {
webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(mainWindow->webkitView),
webkit_web_view_load_html(WEBKIT_WEB_VIEW(mainWindow->webkitView),
text, "");
}