Commit 3c4695ef authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'plaintext-markdown' into 'master'

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

Closes #201

See merge request !102
parents fc8f0b6f 67d81956
Pipeline #57858 failed with stages
in 42 minutes and 19 seconds
......@@ -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