From f6299d9fad21c065d1e4c0f1093770835fb73adf Mon Sep 17 00:00:00 2001 From: Burt P Date: Wed, 24 Oct 2018 00:41:16 -0500 Subject: params: html_ok -> markup_ok The html_ok param added in 970174b0897d40b804808632784ffa1544d9da93 is misleading. It turns out that it is not HTML, but Pango Markup that is used by GTK, and a subset of that happens to also work as HTML4 for the HTML report generation. This change renames html_ok to markup_ok in ProgramParameters and adds a comment explaining what common set of tags may be used. Also, if report generation happens as a fallback after GUI initialization failed, then also disable markup, unless report will be generated as HTML. Pango markup info at: https://developer.gnome.org/pango/stable/PangoMarkupFormat.html Signed-off-by: Burt P --- hardinfo/hardinfo.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'hardinfo/hardinfo.c') diff --git a/hardinfo/hardinfo.c b/hardinfo/hardinfo.c index e1783315..d1d228b3 100644 --- a/hardinfo/hardinfo.c +++ b/hardinfo/hardinfo.c @@ -92,13 +92,17 @@ int main(int argc, char **argv) } if (!params.create_report && !params.run_benchmark) { - /* we only try to open the UI if the user didn't ask for a report. */ - params.gui_running = ui_init(&argc, &argv); - - /* as a fallback, if GTK+ initialization failed, run in report - generation mode. */ - if (!params.gui_running) - params.create_report = TRUE; + /* we only try to open the UI if the user didn't ask for a report. */ + params.gui_running = ui_init(&argc, &argv); + + /* as a fallback, if GTK+ initialization failed, run in report + generation mode. */ + if (!params.gui_running) { + params.create_report = TRUE; + /* ... it is possible to -f html without -r */ + if (params.report_format != REPORT_FORMAT_HTML) + params.markup_ok = FALSE; + } } if (params.use_modules) { -- cgit v1.2.3