~ubuntu-branches/ubuntu/saucy/geary/saucy-updates

« back to all changes in this revision

Viewing changes to src/engine/util/util-html.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2013-03-14 13:48:23 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130314134823-gyk5av1g508zyj8a
Tags: 0.3.0~pr1-0ubuntu1
New upstream version (FFE lp: #1154316), supports multiple account as
well as full conversation views with inline replies

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    return (!String.is_empty(plain) && plain.validate()) ? Markup.escape_text(plain) : "";
11
11
}
12
12
 
13
 
public inline string newlines_to_br(string? text) {
14
 
    return !String.is_empty(text) ? text.replace("\n", "<br />") : "";
 
13
public string preserve_whitespace(string? text) {
 
14
    if (String.is_empty(text))
 
15
        return "";
 
16
    
 
17
    string output = text.replace(" ", "&nbsp;");
 
18
    output = output.replace("\r\n", "<br />");
 
19
    output = output.replace("\n", "<br />");
 
20
    output = output.replace("\r", "<br />");
 
21
 
 
22
    return output;
15
23
}
16
24
 
17
25
// Removes any text between < and >.  Additionally, if input terminates in the middle of a tag,