Unscrew Redraft

This commit is contained in:
bleakgrey 2018-10-30 20:40:47 +03:00
parent 11b8cc8034
commit 938f4aac0c
2 changed files with 8 additions and 4 deletions

View File

@ -207,6 +207,7 @@ public class Tootle.PostDialog : Gtk.Dialog {
var content = Html.simplify (status.content);
content = Html.remove_tags (content);
content = RichLabel.restore_entities (content);
dialog.text.buffer.text = content;
}

View File

@ -12,14 +12,17 @@ public class Tootle.RichLabel : Gtk.Label {
public static string escape_entities (string content) {
return content
.replace ("&", "&")
.replace ("'", "'");
.replace ("&", "&")
.replace ("'", "'");
}
public static string restore_entities (string content) {
return content
.replace ("&", "&")
.replace ("'", "'");
.replace ("&", "&")
.replace ("&lt;", "<")
.replace ("&gt;", ">")
.replace ("&apos;", "'")
.replace ("&quot;", "\"");
}
public new void set_label (string text) {