|
a/src/internfile/myhtmlparse.cpp |
|
b/src/internfile/myhtmlparse.cpp |
|
... |
|
... |
25 |
|
25 |
|
26 |
#include "indextext.h" // for lowercase_term()
|
26 |
#include "indextext.h" // for lowercase_term()
|
27 |
|
27 |
|
28 |
#include "mimeparse.h"
|
28 |
#include "mimeparse.h"
|
29 |
|
29 |
|
|
|
30 |
// The original version for this compresses whitespace and suppresses newlines
|
|
|
31 |
// I can see no good reason to do this, and it actually helps preview to keep
|
|
|
32 |
// whitespace, especially if the html comes from a filter that generated it
|
|
|
33 |
// from text (ie: inside '<pre> tags)
|
30 |
void
|
34 |
void
|
31 |
MyHtmlParser::process_text(const string &text)
|
35 |
MyHtmlParser::process_text(const string &text)
|
32 |
{
|
36 |
{
|
33 |
if (!in_script_tag && !in_style_tag) {
|
37 |
if (!in_script_tag && !in_style_tag) {
|
|
|
38 |
#if 0
|
34 |
string::size_type b = 0;
|
39 |
string::size_type b = 0;
|
35 |
while ((b = text.find_first_not_of(WHITESPACE, b)) != string::npos) {
|
40 |
while ((b = text.find_first_not_of(WHITESPACE, b)) != string::npos) {
|
36 |
if (pending_space || b != 0)
|
41 |
if (pending_space || b != 0)
|
37 |
if (!dump.empty()) dump += ' ';
|
42 |
if (!dump.empty()) dump += ' ';
|
38 |
pending_space = true;
|
43 |
pending_space = true;
|
|
... |
|
... |
43 |
break;
|
48 |
break;
|
44 |
}
|
49 |
}
|
45 |
dump += text.substr(b, e - b);
|
50 |
dump += text.substr(b, e - b);
|
46 |
b = e + 1;
|
51 |
b = e + 1;
|
47 |
}
|
52 |
}
|
|
|
53 |
#else
|
|
|
54 |
if (pending_space)
|
|
|
55 |
dump += ' ';
|
|
|
56 |
dump += text;
|
|
|
57 |
#endif
|
48 |
}
|
58 |
}
|
49 |
}
|
59 |
}
|
50 |
|
60 |
|
51 |
void
|
61 |
void
|
52 |
MyHtmlParser::opening_tag(const string &tag, const map<string,string> &p)
|
62 |
MyHtmlParser::opening_tag(const string &tag, const map<string,string> &p)
|