Maintain tables from HTML email in when using HTML to Markdown

I was trying to advise a user on how they might import a Google Doc into Discourse as a new topic and suggested trying to copy/paste the doc into an email and then email it in. It mostly worked, but there were a few tables in the doc that got mangled in the process.

When an email into Discourse includes an HTML table, that table gets mangled and turned into plaintext on the Discourse side.

I have the incoming_email_prefer_html on as well as the “allow html tables” setting.

It’d be cool if tables were just skipped and maintained as HTML in that case. (Or perhaps there’s a table extension we’re planning on enabling once the markdown-it is in the mix?)

7 إعجابات

This might work better now that we have more formal Markdown table support @vinothkannans?

Yes, it will work better if the user used copy-paste method instead of email-in workaround.

HTML pasting feature uses client side JavaScript for Markdown conversion. But for incoming emails we converting it in server side using our custom converter which doesn’t support Markdown tables yet.

3 إعجابات

I see no point in duplicating our code in JS and Ruby. I will remove the Ruby version and replace it with the JS version.

8 إعجابات

أحصل بطبيعة الحال على رسائل بريد إلكتروني تحتوي على جداول، ولا ينجو الجدول الأول وما يليه من الترجمة إلى تنسيق Markdown. وهذا يتسبب في انقطاع الرسائل بشكل مفاجئ، مما يُربك المستخدمين. في حين يمكنهم قراءة رسالة البريد الإلكتروني الأصلية بتنسيق HTML بالنقر على أيقونة الظرف الصغيرة، إلا أن هذا ليس سهل الاستخدام على الإطلاق، وينبغي على الأرجح اعتباره خللاً تقنياً.

يبدو أن تعديل الرسالة ولصق جدول HTML الخام فيها يعمل بشكل جيد. فلماذا لا يتم ذلك أثناء عملية التحويل إلى Markdown؟

سيتم تحويل الجداول بشكل صحيح بعد دمج هذا الطلب :ok_hand:

5 إعجابات