preview/plaintorich: add <br> tags at end of text/plain lines instead of using <pre> tag (allows line wrapping).
This commit is contained in:
parent
43230c1c60
commit
7eb7bd52bb
@ -122,6 +122,8 @@ void rwSettings(bool writing)
|
||||
SETTING_RW(prefs.showResultsAsTable,
|
||||
"/Recoll/prefs/showResultsAsTable", Bool, false);
|
||||
SETTING_RW(prefs.maxhltextmbs, "/Recoll/prefs/preview/maxhltextmbs", Int, 3);
|
||||
SETTING_RW(prefs.previewPlainPre,
|
||||
"/Recoll/prefs/preview/plainPre", Bool, false);
|
||||
SETTING_RW(prefs.qtermcolor, "/Recoll/prefs/qtermcolor", String, "blue");
|
||||
if (!writing && prefs.qtermcolor == "")
|
||||
prefs.qtermcolor = "blue";
|
||||
|
||||
@ -80,7 +80,11 @@ class PrefsPack {
|
||||
bool queryBuildAbstract;
|
||||
bool queryReplaceAbstract;
|
||||
bool startWithAdvSearchOpen;
|
||||
// Try to display html if it exists in the internfile stack.
|
||||
bool previewHtml;
|
||||
// Use <pre> tag to display highlighted text/plain inside html (else
|
||||
// we use <br> at end of lines, which lets textedit wrap lines).
|
||||
bool previewPlainPre;
|
||||
bool collapseDuplicates;
|
||||
bool showResultsAsTable;
|
||||
|
||||
@ -130,9 +134,8 @@ class PrefsPack {
|
||||
queryReplaceAbstract(false),
|
||||
startWithAdvSearchOpen(false),
|
||||
termMatchType(0),
|
||||
rclVersion(1009)
|
||||
{
|
||||
}
|
||||
rclVersion(1505)
|
||||
{ }
|
||||
};
|
||||
|
||||
/** Global preferences record */
|
||||
|
||||
@ -80,7 +80,13 @@ public:
|
||||
if (m_inputhtml) {
|
||||
return snull;
|
||||
} else {
|
||||
return string("<qt><head><title></title></head><body><pre>");
|
||||
if (prefs.previewPlainPre) {
|
||||
m_eolbr = false;
|
||||
return string("<qt><head><title></title></head><body><pre>");
|
||||
} else {
|
||||
m_eolbr = true;
|
||||
return string("<qt><head><title></title></head><body>");
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual string startMatch()
|
||||
|
||||
@ -435,6 +435,8 @@ bool PlainToRich::plaintorich(const string& in,
|
||||
if (eol > 2)
|
||||
eol = 2;
|
||||
while (eol) {
|
||||
if (!m_inputhtml && m_eolbr)
|
||||
*olit += "<br>";
|
||||
*olit += "\n";
|
||||
eol--;
|
||||
}
|
||||
|
||||
@ -89,6 +89,8 @@ public:
|
||||
protected:
|
||||
static const string snull;
|
||||
bool m_inputhtml;
|
||||
// Use <br> to break plain text lines (else caller has used a <pre> tag)
|
||||
bool m_eolbr;
|
||||
};
|
||||
|
||||
#endif /* _PLAINTORICH_H_INCLUDED_ */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user