Commit 67d81956 authored by Alex Henrie's avatar Alex Henrie

Don't add Geary-flavored markdown to plain text messages

Fixes #201
parent fc8f0b6f
......@@ -489,7 +489,9 @@ ComposerPageState.htmlToText = function(root) {
}
break;
case "a":
if (node.textContent == node.href) {
if (node.closest("body.plain")) {
text += ComposerPageState.htmlToText(node);
} else if (node.textContent == node.href) {
text += "<" + node.href + ">";
} else {
text += ComposerPageState.htmlToText(node);
......@@ -498,7 +500,11 @@ ComposerPageState.htmlToText = function(root) {
break;
case "b":
case "strong":
text += "*" + ComposerPageState.htmlToText(node) + "*";
if (node.closest("body.plain")) {
text += ComposerPageState.htmlToText(node);
} else {
text += "*" + ComposerPageState.htmlToText(node) + "*";
}
break;
case "blockquote":
let bqText = ComposerPageState.htmlToText(node);
......@@ -515,10 +521,18 @@ ComposerPageState.htmlToText = function(root) {
break;
case "i":
case "em":
text += "/" + ComposerPageState.htmlToText(node) + "/";
if (node.closest("body.plain")) {
text += ComposerPageState.htmlToText(node);
} else {
text += "/" + ComposerPageState.htmlToText(node) + "/";
}
break;
case "u":
text += "_" + ComposerPageState.htmlToText(node) + "_";
if (node.closest("body.plain")) {
text += ComposerPageState.htmlToText(node);
} else {
text += "_" + ComposerPageState.htmlToText(node) + "_";
}
break;
case "#comment":
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment