Updated load_html function of webkit to version 2
This commit is contained in:
parent
aa8a9a003b
commit
b0b6a553b7
@ -708,17 +708,17 @@ static void mainWindow_set_text(struct mainWindow *mainWindow, gchar *text, gcha
|
|||||||
cmd = g_strdup_printf("markdown %s", tempfile_path);
|
cmd = g_strdup_printf("markdown %s", tempfile_path);
|
||||||
if (g_spawn_command_line_sync(cmd, &cmd_stdout, &cmd_stderr, &exit_status, NULL) &&
|
if (g_spawn_command_line_sync(cmd, &cmd_stdout, &cmd_stderr, &exit_status, NULL) &&
|
||||||
exit_status == 0) {
|
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);
|
cmd_stdout, base_url);
|
||||||
} else {
|
} else {
|
||||||
g_warning("Could not render markdown for file. Showing plain text instead.\n");
|
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);
|
text, base_url);
|
||||||
}
|
}
|
||||||
g_free(base_url);
|
g_free(base_url);
|
||||||
} else {
|
} else {
|
||||||
webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(mainWindow->webkitView),
|
webkit_web_view_load_html(WEBKIT_WEB_VIEW(mainWindow->webkitView),
|
||||||
text, "");
|
text, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream) {
|
if (stream) {
|
||||||
|
Loading…
Reference in New Issue
Block a user