Changeset View
Changeset View
Standalone View
Standalone View
src/backends/R/rexpression.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 106 | { | |||
---|---|---|---|---|---|
119 | } | 119 | } | ||
120 | QString content=QTextStream(&f).readAll(); | 120 | QString content=QTextStream(&f).readAll(); | ||
121 | if (!type.inherits(QLatin1String("text/html"))) | 121 | if (!type.inherits(QLatin1String("text/html"))) | ||
122 | { | 122 | { | ||
123 | //Escape whitespace | 123 | //Escape whitespace | ||
124 | content.replace( QLatin1Char(' '), QLatin1String(" ")); | 124 | content.replace( QLatin1Char(' '), QLatin1String(" ")); | ||
125 | //replace appearing backspaces, as they mess the whole output up | 125 | //replace appearing backspaces, as they mess the whole output up | ||
126 | content.remove(QRegExp(QLatin1String(".\b"))); | 126 | content.remove(QRegExp(QLatin1String(".\b"))); | ||
127 | //Replace < and > with their html code, so they won't be confused as html tags | 127 | //Replace <, > and & with their html code, so they won't be confused as html tags | ||
128 | content.replace( QLatin1Char('<') , QLatin1String("<")); | 128 | content.replace( QLatin1Char('<') , QLatin1String("<")); | ||
129 | content.replace( QLatin1Char('>') , QLatin1String(">")); | 129 | content.replace( QLatin1Char('>') , QLatin1String(">")); | ||
130 | content.replace( QLatin1Char('&') , QLatin1String("&")); | ||||
130 | } | 131 | } | ||
131 | 132 | | |||
132 | qDebug()<<"content: "<<content; | 133 | qDebug()<<"content: "<<content; | ||
133 | if(m_isHelpRequest) | 134 | if(m_isHelpRequest) | ||
134 | setResult(new Cantor::HelpResult(content)); | 135 | setResult(new Cantor::HelpResult(content)); | ||
135 | else | 136 | else | ||
136 | setResult(new Cantor::TextResult(content)); | 137 | setResult(new Cantor::TextResult(content)); | ||
137 | setStatus(Cantor::Expression::Done); | 138 | setStatus(Cantor::Expression::Done); | ||
Show All 14 Lines |