File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,12 @@ void QgsPythonDialog::on_edtCmdLine_returnPressed()
43
43
{
44
44
QgsPythonUtils::evalString (" sys.stdout.data" , output);
45
45
QgsPythonUtils::runString (" sys.stdout.data = ''" );
46
-
47
- output += QgsPythonUtils::getResult ();
46
+ QString result = QgsPythonUtils::getResult ();
47
+ // escape the result so python objects display properly and
48
+ // we can still use html output to get nicely formatted display
49
+ result.replace (" <" ," <" );
50
+ result.replace (" >" ," >" );
51
+ output += result;
48
52
49
53
if (!output.isEmpty ())
50
54
output += " <br>" ;
@@ -56,8 +60,8 @@ void QgsPythonDialog::on_edtCmdLine_returnPressed()
56
60
57
61
output = " <font color=\" red\" >" + className + " : " + errorText + " </font><br>" ;
58
62
}
59
-
60
- QString str = " <b><font color=\" green\" >>>></font> " + command + " </b><br>" + output;
63
+
64
+ QString str = " <b><font color=\" green\" >>>></font> " + command. replace ( " < " , " < " ) + " </b><br>" + output;
61
65
txtHistory->setText (txtHistory->text () + str);
62
66
edtCmdLine->setText (" " );
63
67
You can’t perform that action at this time.
0 commit comments