From 8fb706753153d79af49a568397773d3d75814ab0 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sat, 14 Sep 2024 14:00:36 +0200 Subject: [PATCH] Added option to convert HTML to Markdown instead of plain, using Turndown #1604 --- dev/Common/Html.js | 17 +- dev/Common/Links.js | 1 + dev/Settings/User/General.js | 4 +- dev/Stores/User/Settings.js | 4 +- .../0.0.0/app/libraries/RainLoop/Actions.php | 4 +- .../app/libraries/RainLoop/Actions/User.php | 1 + .../v/0.0.0/app/localization/ar/user.json | 3 +- .../v/0.0.0/app/localization/be/user.json | 3 +- .../v/0.0.0/app/localization/bg/user.json | 3 +- .../v/0.0.0/app/localization/cs/user.json | 3 +- .../v/0.0.0/app/localization/da/user.json | 3 +- .../v/0.0.0/app/localization/de/user.json | 3 +- .../v/0.0.0/app/localization/el/user.json | 3 +- .../v/0.0.0/app/localization/en/user.json | 3 +- .../v/0.0.0/app/localization/es/user.json | 3 +- .../v/0.0.0/app/localization/et/user.json | 3 +- .../v/0.0.0/app/localization/eu/user.json | 3 +- .../v/0.0.0/app/localization/fa/user.json | 3 +- .../v/0.0.0/app/localization/fi/user.json | 3 +- .../v/0.0.0/app/localization/fr/user.json | 3 +- .../v/0.0.0/app/localization/hu/user.json | 3 +- .../v/0.0.0/app/localization/id/user.json | 3 +- .../v/0.0.0/app/localization/is/user.json | 3 +- .../v/0.0.0/app/localization/it/user.json | 3 +- .../v/0.0.0/app/localization/ja/user.json | 3 +- .../v/0.0.0/app/localization/ko/user.json | 3 +- .../v/0.0.0/app/localization/lt/user.json | 3 +- .../v/0.0.0/app/localization/lv/user.json | 3 +- .../v/0.0.0/app/localization/nb/user.json | 3 +- .../v/0.0.0/app/localization/nl/user.json | 3 +- .../v/0.0.0/app/localization/pl/user.json | 3 +- .../v/0.0.0/app/localization/pt-BR/user.json | 3 +- .../v/0.0.0/app/localization/pt/user.json | 3 +- .../v/0.0.0/app/localization/ro/user.json | 3 +- .../v/0.0.0/app/localization/ru/user.json | 3 +- .../v/0.0.0/app/localization/sk/user.json | 3 +- .../v/0.0.0/app/localization/sl/user.json | 3 +- .../v/0.0.0/app/localization/sv/user.json | 3 +- .../v/0.0.0/app/localization/tr/user.json | 3 +- .../v/0.0.0/app/localization/uk/user.json | 3 +- .../v/0.0.0/app/localization/vi/user.json | 3 +- .../v/0.0.0/app/localization/zh-TW/user.json | 3 +- .../v/0.0.0/app/localization/zh/user.json | 3 +- .../templates/Views/User/SettingsGeneral.html | 193 +++++++++--------- tasks/config.js | 1 + 45 files changed, 201 insertions(+), 135 deletions(-) diff --git a/dev/Common/Html.js b/dev/Common/Html.js index f3a9d82c7..07d975224 100644 --- a/dev/Common/Html.js +++ b/dev/Common/Html.js @@ -4,6 +4,9 @@ import { SettingsUserStore } from 'Stores/User/Settings'; const tmpl = createElement('template'), + + turndown = new TurndownService(), + htmlre = /[&<>"']/g, httpre = /^(https?:)?\/\//i, htmlmap = { @@ -604,6 +607,9 @@ export const * @returns {string} */ htmlToPlain = html => { + if (SettingsUserStore.markdown()) { + return htmlToMarkdown(html); + } const hr = '⎯'.repeat(64), forEach = (selector, fn) => tmpl.content.querySelectorAll(selector).forEach(fn), @@ -640,6 +646,8 @@ export const .replace(//gi, '\t') .replace(/<\/tr(\s[\s\S]*?)?>/gi, '\n'); + forEach('style', node => node.remove()); + // lines forEach('hr', node => node.replaceWith(`\n\n${hr}\n\n`)); @@ -700,6 +708,11 @@ export const return (tmpl.content.textContent || '').trim(); }, + htmlToMarkdown = html => { + tmpl.innerHTML = html; + return turndown.turndown(tmpl.content); + }, + /** * @param {string} plain * @param {boolean} findEmailAndLinksInText = false @@ -771,5 +784,7 @@ export const rl.Utils = { htmlToPlain: htmlToPlain, - plainToHtml: plainToHtml + plainToHtml: plainToHtml, + htmlToMarkdown: htmlToMarkdown +// markdownToHtml: md => marked.parse(md) }; diff --git a/dev/Common/Links.js b/dev/Common/Links.js index d5a8f6416..c0923ed58 100644 --- a/dev/Common/Links.js +++ b/dev/Common/Links.js @@ -45,6 +45,7 @@ export const proxy = url => BASE + '?/ProxyExternal/' +// + btoa(JSON.stringify([token,url]).replace(/ /g, '%20')).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''), + btoa(url.replace(/ /g, '%20')).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''), // + b64EncodeJSONSafe(url.replace(/ /g, '%20')), diff --git a/dev/Settings/User/General.js b/dev/Settings/User/General.js index edeb3e2de..a05a3227d 100644 --- a/dev/Settings/User/General.js +++ b/dev/Settings/User/General.js @@ -62,7 +62,7 @@ export class UserSettingsGeneral extends AbstractViewSettings { 'viewHTML', 'viewImages', 'viewImagesWhitelist', 'removeColors', 'allowStyles', 'allowDraftAutosave', 'hideDeleted', 'listInlineAttachments', 'simpleAttachmentsList', 'collapseBlockquotes', 'useCheckboxesInList', 'listGrouped', 'replySameFolder', 'allowSpellcheck', - 'messageReadAuto', 'showNextMessage', 'messageNewWindow' + 'messageReadAuto', 'showNextMessage', 'messageNewWindow', 'markdown' ].forEach(name => this[name] = SettingsUserStore[name]); this.allowLanguagesOnSettings = !!SettingsGet('allowLanguagesOnSettings'); @@ -123,7 +123,7 @@ export class UserSettingsGeneral extends AbstractViewSettings { 'ViewHTML', 'ViewImages', 'ViewImagesWhitelist', 'RemoveColors', 'AllowStyles', 'AllowDraftAutosave', 'HideDeleted', 'ListInlineAttachments', 'simpleAttachmentsList', 'CollapseBlockquotes', 'UseCheckboxesInList', 'listGrouped', 'ReplySameFolder', 'allowSpellcheck', - 'messageReadAuto', 'showNextMessage', 'messageNewWindow', + 'messageReadAuto', 'showNextMessage', 'messageNewWindow', 'markdown', 'DesktopNotifications', 'SoundNotification']); const fReloadLanguageHelper = (saveSettingsStep) => () => { diff --git a/dev/Stores/User/Settings.js b/dev/Stores/User/Settings.js index 98d9620c6..382c74289 100644 --- a/dev/Stores/User/Settings.js +++ b/dev/Stores/User/Settings.js @@ -50,6 +50,7 @@ export const SettingsUserStore = new class { layout: 1, editorDefaultType: 'Html', editorWysiwyg: 'Squire', + markdown: 0, msgDefaultAction: 1 }); @@ -113,7 +114,8 @@ export const SettingsUserStore = new class { 'requireTLS', 'pgpSign', 'pgpEncrypt', - 'allowSpellcheck' + 'allowSpellcheck', + 'markdown' /* 'MessagesPerPage', 'MessageReadDelay', diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index bed876eb2..e1f93e00b 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -595,6 +595,7 @@ class Actions 'listGrouped' => $oConfig->Get('defaults', 'mail_list_grouped', false), 'MessagesPerPage' => \max(10, \intval($oConfig->Get('webmail', 'messages_per_page', 25)) ?: 25), 'messageNewWindow' => false, + 'markdown' => false, 'messageReadAuto' => true, // (bool) $oConfig->Get('webmail', 'message_read_auto', true), 'MessageReadDelay' => (int) $oConfig->Get('webmail', 'message_read_delay', 5), 'MsgDefaultAction' => (int) $oConfig->Get('defaults', 'msg_default_action', 1), @@ -690,7 +691,8 @@ class Actions $aResult['listGrouped'] = (bool)$oSettings->GetConf('listGrouped', $aResult['listGrouped']); $aResult['ContactsAutosave'] = (bool)$oSettings->GetConf('ContactsAutosave', $aResult['ContactsAutosave']); $aResult['MessagesPerPage'] = \max(10, \intval($oSettings->GetConf('MessagesPerPage', $aResult['MessagesPerPage']) ?: $aResult['MessagesPerPage'])); - $aResult['messageNewWindow'] = (int)$oSettings->GetConf('messageNewWindow', $aResult['messageNewWindow']); + $aResult['messageNewWindow'] = (bool)$oSettings->GetConf('messageNewWindow', $aResult['messageNewWindow']); + $aResult['markdown'] = (bool)$oSettings->GetConf('markdown', $aResult['markdown']); $aResult['messageReadAuto'] = (int)$oSettings->GetConf('messageReadAuto', $aResult['messageReadAuto']); $aResult['MessageReadDelay'] = (int)$oSettings->GetConf('MessageReadDelay', $aResult['MessageReadDelay']); $aResult['MsgDefaultAction'] = (int)$oSettings->GetConf('MsgDefaultAction', $aResult['MsgDefaultAction']); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php index 6367cd79e..014f403e7 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/User.php @@ -198,6 +198,7 @@ trait User $this->setSettingsFromParams($oSettings, 'MessageReadDelay', 'int'); $this->setSettingsFromParams($oSettings, 'MsgDefaultAction', 'int'); $this->setSettingsFromParams($oSettings, 'showNextMessage', 'bool'); + $this->setSettingsFromParams($oSettings, 'markdown', 'bool'); $this->setSettingsFromParams($oSettings, 'Resizer4Width', 'int'); $this->setSettingsFromParams($oSettings, 'Resizer5Width', 'int'); diff --git a/snappymail/v/0.0.0/app/localization/ar/user.json b/snappymail/v/0.0.0/app/localization/ar/user.json index e6ecc4ad6..dd8e7edd0 100644 --- a/snappymail/v/0.0.0/app/localization/ar/user.json +++ b/snappymail/v/0.0.0/app/localization/ar/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "قم باضافة المستلمين تلقائيا الى دفتر العناوين", diff --git a/snappymail/v/0.0.0/app/localization/be/user.json b/snappymail/v/0.0.0/app/localization/be/user.json index 7ad8e2544..43fa3e68c 100644 --- a/snappymail/v/0.0.0/app/localization/be/user.json +++ b/snappymail/v/0.0.0/app/localization/be/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Показваць заўсёды", "IMAGES_WHITELIST": "Фарматы з белага спісу", "MESSAGE_POPUP_WINDOW": "Усплываючае вакно ў новым вакне замест карткі", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Аўтаматычна дадаваць атрымальнікаў лістоў у адрасную кнігу", diff --git a/snappymail/v/0.0.0/app/localization/bg/user.json b/snappymail/v/0.0.0/app/localization/bg/user.json index 55c1035e6..04039fb6e 100644 --- a/snappymail/v/0.0.0/app/localization/bg/user.json +++ b/snappymail/v/0.0.0/app/localization/bg/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Автоматично добавяне на получателите към адресната ви книга", diff --git a/snappymail/v/0.0.0/app/localization/cs/user.json b/snappymail/v/0.0.0/app/localization/cs/user.json index faac7fc0c..c394aa303 100644 --- a/snappymail/v/0.0.0/app/localization/cs/user.json +++ b/snappymail/v/0.0.0/app/localization/cs/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automaticky přidávat adresy příjemců do Adresáře", diff --git a/snappymail/v/0.0.0/app/localization/da/user.json b/snappymail/v/0.0.0/app/localization/da/user.json index 03ffa43e2..8f31cfc14 100644 --- a/snappymail/v/0.0.0/app/localization/da/user.json +++ b/snappymail/v/0.0.0/app/localization/da/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Tilføj automatisk modtager til adressebog", diff --git a/snappymail/v/0.0.0/app/localization/de/user.json b/snappymail/v/0.0.0/app/localization/de/user.json index 952536106..d18b083cb 100644 --- a/snappymail/v/0.0.0/app/localization/de/user.json +++ b/snappymail/v/0.0.0/app/localization/de/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Immer anzeigen", "IMAGES_WHITELIST": "Ausnahmeliste für Bilder", "MESSAGE_POPUP_WINDOW": "In neuem Fenster statt Tab anzeigen", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Empfänger automatisch zu Ihrem Adressbuch hinzuzufügen", diff --git a/snappymail/v/0.0.0/app/localization/el/user.json b/snappymail/v/0.0.0/app/localization/el/user.json index 02bdecfe3..570f48680 100644 --- a/snappymail/v/0.0.0/app/localization/el/user.json +++ b/snappymail/v/0.0.0/app/localization/el/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Αυτόματη προσθήκη επαφών στον κατάλογο διευθύνσεων", diff --git a/snappymail/v/0.0.0/app/localization/en/user.json b/snappymail/v/0.0.0/app/localization/en/user.json index 44bf9b67c..c2db3f1d7 100644 --- a/snappymail/v/0.0.0/app/localization/en/user.json +++ b/snappymail/v/0.0.0/app/localization/en/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automatically add recipients to your address book", diff --git a/snappymail/v/0.0.0/app/localization/es/user.json b/snappymail/v/0.0.0/app/localization/es/user.json index 08e327d27..602602120 100644 --- a/snappymail/v/0.0.0/app/localization/es/user.json +++ b/snappymail/v/0.0.0/app/localization/es/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Mostrar siempre", "IMAGES_WHITELIST": "Lista blanca de imágenes", "MESSAGE_POPUP_WINDOW": "Popup en nueva ventana en lugar de pestaña", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Agregar automáticamente destinatarios a la libreta de direcciones", diff --git a/snappymail/v/0.0.0/app/localization/et/user.json b/snappymail/v/0.0.0/app/localization/et/user.json index e6d17f204..a8ded8627 100644 --- a/snappymail/v/0.0.0/app/localization/et/user.json +++ b/snappymail/v/0.0.0/app/localization/et/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Lisa saajad automaatselt aadressiraamatusse", diff --git a/snappymail/v/0.0.0/app/localization/eu/user.json b/snappymail/v/0.0.0/app/localization/eu/user.json index 008449b37..663a20d5b 100644 --- a/snappymail/v/0.0.0/app/localization/eu/user.json +++ b/snappymail/v/0.0.0/app/localization/eu/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automatikoki gehitu hartzaileak helbide-liburura", diff --git a/snappymail/v/0.0.0/app/localization/fa/user.json b/snappymail/v/0.0.0/app/localization/fa/user.json index e11831efc..0a556ddc3 100644 --- a/snappymail/v/0.0.0/app/localization/fa/user.json +++ b/snappymail/v/0.0.0/app/localization/fa/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "اطلاعات تماس گیرندگان را بصورت خودکار در آدرس‌بوک ذخیره کن", diff --git a/snappymail/v/0.0.0/app/localization/fi/user.json b/snappymail/v/0.0.0/app/localization/fi/user.json index 94606bf84..7a17501b6 100644 --- a/snappymail/v/0.0.0/app/localization/fi/user.json +++ b/snappymail/v/0.0.0/app/localization/fi/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Lisää yhetystieto automaattisesti osoitekirjaan", diff --git a/snappymail/v/0.0.0/app/localization/fr/user.json b/snappymail/v/0.0.0/app/localization/fr/user.json index 0f594a582..8daeb8aa0 100644 --- a/snappymail/v/0.0.0/app/localization/fr/user.json +++ b/snappymail/v/0.0.0/app/localization/fr/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Toujours afficher", "IMAGES_WHITELIST": "Liste blanche Images", "MESSAGE_POPUP_WINDOW": "Popup dans une nouvelle fenêtre au lieu d'un onglet", - "MAILTO": "Inscrivez-vous en tant que gestionnaire de liens 'mailto:'" + "MAILTO": "Inscrivez-vous en tant que gestionnaire de liens 'mailto:'", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Ajouter automatiquement les destinataires à votre carnet d'adresses", diff --git a/snappymail/v/0.0.0/app/localization/hu/user.json b/snappymail/v/0.0.0/app/localization/hu/user.json index de51b1f8b..d36e40d19 100644 --- a/snappymail/v/0.0.0/app/localization/hu/user.json +++ b/snappymail/v/0.0.0/app/localization/hu/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Címzettek automatikus hozzáadása a címtárhoz", diff --git a/snappymail/v/0.0.0/app/localization/id/user.json b/snappymail/v/0.0.0/app/localization/id/user.json index b08590901..4a529c0b2 100644 --- a/snappymail/v/0.0.0/app/localization/id/user.json +++ b/snappymail/v/0.0.0/app/localization/id/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Tambah penerima ke daftar alamat secara otomatis", diff --git a/snappymail/v/0.0.0/app/localization/is/user.json b/snappymail/v/0.0.0/app/localization/is/user.json index 4eb403353..bdd931ee0 100644 --- a/snappymail/v/0.0.0/app/localization/is/user.json +++ b/snappymail/v/0.0.0/app/localization/is/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Bæta viðtakendum sjálfkrafa í nafnaskrá", diff --git a/snappymail/v/0.0.0/app/localization/it/user.json b/snappymail/v/0.0.0/app/localization/it/user.json index d365bbacd..ddfe3cba0 100644 --- a/snappymail/v/0.0.0/app/localization/it/user.json +++ b/snappymail/v/0.0.0/app/localization/it/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Visualizza sempre", "IMAGES_WHITELIST": "Whitelist per immagini", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Aggiungi automaticamente le persone che ti inviano mail alla rubrica", diff --git a/snappymail/v/0.0.0/app/localization/ja/user.json b/snappymail/v/0.0.0/app/localization/ja/user.json index 4421a531d..4bd5c018c 100644 --- a/snappymail/v/0.0.0/app/localization/ja/user.json +++ b/snappymail/v/0.0.0/app/localization/ja/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "返信したアドレスをアドレス帳へ自動的に追加する", diff --git a/snappymail/v/0.0.0/app/localization/ko/user.json b/snappymail/v/0.0.0/app/localization/ko/user.json index 39fbcafa3..ec5ab9ddc 100644 --- a/snappymail/v/0.0.0/app/localization/ko/user.json +++ b/snappymail/v/0.0.0/app/localization/ko/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "수신인을 주소록에 자동으로 추가", diff --git a/snappymail/v/0.0.0/app/localization/lt/user.json b/snappymail/v/0.0.0/app/localization/lt/user.json index 24fce3bc6..591d0b6f3 100644 --- a/snappymail/v/0.0.0/app/localization/lt/user.json +++ b/snappymail/v/0.0.0/app/localization/lt/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automatiškai pridėti gavėjus į adresų knygą", diff --git a/snappymail/v/0.0.0/app/localization/lv/user.json b/snappymail/v/0.0.0/app/localization/lv/user.json index 4fddba713..af114823a 100644 --- a/snappymail/v/0.0.0/app/localization/lv/user.json +++ b/snappymail/v/0.0.0/app/localization/lv/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automatically add recipients to your address book", diff --git a/snappymail/v/0.0.0/app/localization/nb/user.json b/snappymail/v/0.0.0/app/localization/nb/user.json index 1b65e91fd..58d815411 100644 --- a/snappymail/v/0.0.0/app/localization/nb/user.json +++ b/snappymail/v/0.0.0/app/localization/nb/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Legg til mottakere i adresseboka automatisk", diff --git a/snappymail/v/0.0.0/app/localization/nl/user.json b/snappymail/v/0.0.0/app/localization/nl/user.json index bc4e95b09..2654a7d73 100644 --- a/snappymail/v/0.0.0/app/localization/nl/user.json +++ b/snappymail/v/0.0.0/app/localization/nl/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Altijd tonen", "IMAGES_WHITELIST": "Afbeeldingen whitelist", "MESSAGE_POPUP_WINDOW": "Openen in een nieuw venster i.p.v. tab", - "MAILTO": "Registreer als 'mailto:'-linkhandler" + "MAILTO": "Registreer als 'mailto:'-linkhandler", + "HTML_TO_MD": "Converteer HTML naar Markdown i.p.v. platte tekst" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automatisch ontvangers toevoegen aan uw adresboek", diff --git a/snappymail/v/0.0.0/app/localization/pl/user.json b/snappymail/v/0.0.0/app/localization/pl/user.json index e60028201..853adf389 100644 --- a/snappymail/v/0.0.0/app/localization/pl/user.json +++ b/snappymail/v/0.0.0/app/localization/pl/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Zawsze pokazuj", "IMAGES_WHITELIST": "Biała lista obrazów", "MESSAGE_POPUP_WINDOW": "Pokaż w nowym oknie zamiast w nowej karcie", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automatycznie dodawaj odbiorców do książki adresowej", diff --git a/snappymail/v/0.0.0/app/localization/pt-BR/user.json b/snappymail/v/0.0.0/app/localization/pt-BR/user.json index bad9a4578..935e9aca9 100644 --- a/snappymail/v/0.0.0/app/localization/pt-BR/user.json +++ b/snappymail/v/0.0.0/app/localization/pt-BR/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Adicionar automaticamente os destinatários na lista de endereços", diff --git a/snappymail/v/0.0.0/app/localization/pt/user.json b/snappymail/v/0.0.0/app/localization/pt/user.json index e93ca5d08..df7a8f9c6 100644 --- a/snappymail/v/0.0.0/app/localization/pt/user.json +++ b/snappymail/v/0.0.0/app/localization/pt/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Mostrar sempre", "IMAGES_WHITELIST": "Lista Branca de imagens", "MESSAGE_POPUP_WINDOW": "Abrir em nova janela em vez de um separador", - "MAILTO": "Registar como manipulador de ligações 'mailto:'" + "MAILTO": "Registar como manipulador de ligações 'mailto:'", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Adicionar destinatários automaticamente à sua lista de endereços", diff --git a/snappymail/v/0.0.0/app/localization/ro/user.json b/snappymail/v/0.0.0/app/localization/ro/user.json index 665c1ce51..e411c3671 100644 --- a/snappymail/v/0.0.0/app/localization/ro/user.json +++ b/snappymail/v/0.0.0/app/localization/ro/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Adaugă automat destinatarii la agenda de scrisori", diff --git a/snappymail/v/0.0.0/app/localization/ru/user.json b/snappymail/v/0.0.0/app/localization/ru/user.json index 37bcd5f51..fb9e5340c 100644 --- a/snappymail/v/0.0.0/app/localization/ru/user.json +++ b/snappymail/v/0.0.0/app/localization/ru/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Показать всегда", "IMAGES_WHITELIST": "Форматы из белого списка", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Автоматически добавлять получателей писем в адресную книгу", diff --git a/snappymail/v/0.0.0/app/localization/sk/user.json b/snappymail/v/0.0.0/app/localization/sk/user.json index 7e3a39d15..67f4f3e67 100644 --- a/snappymail/v/0.0.0/app/localization/sk/user.json +++ b/snappymail/v/0.0.0/app/localization/sk/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Automaticky pridávať príjemcov správ do Adresára", diff --git a/snappymail/v/0.0.0/app/localization/sl/user.json b/snappymail/v/0.0.0/app/localization/sl/user.json index f0c49e6fa..30dd28e15 100644 --- a/snappymail/v/0.0.0/app/localization/sl/user.json +++ b/snappymail/v/0.0.0/app/localization/sl/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Samodejno dodaj prejemnike v imenik", diff --git a/snappymail/v/0.0.0/app/localization/sv/user.json b/snappymail/v/0.0.0/app/localization/sv/user.json index b6ae83b90..def3a526c 100644 --- a/snappymail/v/0.0.0/app/localization/sv/user.json +++ b/snappymail/v/0.0.0/app/localization/sv/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Lägg till mottagare automatiskt i din adressbok", diff --git a/snappymail/v/0.0.0/app/localization/tr/user.json b/snappymail/v/0.0.0/app/localization/tr/user.json index ba422f154..25f25c806 100644 --- a/snappymail/v/0.0.0/app/localization/tr/user.json +++ b/snappymail/v/0.0.0/app/localization/tr/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Otomatik olarak adres defterinize alıcıyı ekle", diff --git a/snappymail/v/0.0.0/app/localization/uk/user.json b/snappymail/v/0.0.0/app/localization/uk/user.json index 2258a8cbf..cdc5886e8 100644 --- a/snappymail/v/0.0.0/app/localization/uk/user.json +++ b/snappymail/v/0.0.0/app/localization/uk/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Автоматично додавати отримувачів у адресну книгу", diff --git a/snappymail/v/0.0.0/app/localization/vi/user.json b/snappymail/v/0.0.0/app/localization/vi/user.json index 1761aa08f..cd92440a6 100644 --- a/snappymail/v/0.0.0/app/localization/vi/user.json +++ b/snappymail/v/0.0.0/app/localization/vi/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "Show always", "IMAGES_WHITELIST": "Images whitelist", "MESSAGE_POPUP_WINDOW": "Popup in new window instead of tab", - "MAILTO": "Register as 'mailto:' links handler" + "MAILTO": "Register as 'mailto:' links handler", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "Tự động thêm người nhận thư vào sổ địa chỉ của bạn", diff --git a/snappymail/v/0.0.0/app/localization/zh-TW/user.json b/snappymail/v/0.0.0/app/localization/zh-TW/user.json index a014582dc..906216ad5 100644 --- a/snappymail/v/0.0.0/app/localization/zh-TW/user.json +++ b/snappymail/v/0.0.0/app/localization/zh-TW/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "永遠顯示", "IMAGES_WHITELIST": "圖片白名單", "MESSAGE_POPUP_WINDOW": "在新彈出窗口而非分頁中打開", - "MAILTO": "注冊成 mailto: 連結處理器" + "MAILTO": "注冊成 mailto: 連結處理器", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "自動新增收件者至通訊錄", diff --git a/snappymail/v/0.0.0/app/localization/zh/user.json b/snappymail/v/0.0.0/app/localization/zh/user.json index 753092ec6..898618152 100644 --- a/snappymail/v/0.0.0/app/localization/zh/user.json +++ b/snappymail/v/0.0.0/app/localization/zh/user.json @@ -499,7 +499,8 @@ "IMAGES_OPTION_ALWAYS": "总是显示", "IMAGES_WHITELIST": "图片白名单", "MESSAGE_POPUP_WINDOW": "弹出页面使用新窗口代替新选项卡", - "MAILTO": "注册成 mailto: 链接处理器" + "MAILTO": "注册成 mailto: 链接处理器", + "HTML_TO_MD": "Convert HTML to Markdown instead of plain text" }, "SETTINGS_CONTACTS": { "LABEL_CONTACTS_AUTOSAVE": "自动添加到您的地址簿", diff --git a/snappymail/v/0.0.0/app/templates/Views/User/SettingsGeneral.html b/snappymail/v/0.0.0/app/templates/Views/User/SettingsGeneral.html index 425219a7c..233149db3 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/SettingsGeneral.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/SettingsGeneral.html @@ -49,15 +49,8 @@
-
@@ -109,90 +102,6 @@ -
-
- -
-
-
- -
-
- -
-
-
-
-
-
-
-
-
-
-
- - -
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + +
diff --git a/tasks/config.js b/tasks/config.js index 01bd89b2a..b407e6457 100644 --- a/tasks/config.js +++ b/tasks/config.js @@ -65,6 +65,7 @@ config.paths.js = { // 'vendors/knockout/build/output/knockout-latest.debug.js', 'vendors/squire/build/squire-raw.js', 'vendors/mathiasbynens/punycode.js', + 'vendors/turndown/turndown.js', 'dev/External/SquireUI.js' ] },