# Problemas com o conversor de HTML para Markdown em e-mails recebidos

**URL:** https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518
**Category:** Support
**Created:** [27 Novembro , 2020 19:55 UTC](https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518 "2020-11-27T19:55:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [27 Novembro , 2020 19:55 UTC](https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518/1 "2020-11-27T19:55:46Z")

</div>

Olá.

Utilizamos o hospedagem do Discourse generosamente fornecida para projetos de código aberto para o [discourse.nixos.org](http://discourse.nixos.org). Quando enviamos nosso e-mail [NixOS Weekly](https://weekly.nixos.org/) para o Discourse, o HTML é convertido para Markdown, mas [a formatação parece bastante inadequada](https://discourse.nixos.org/t/nixos-weekly-09-nixos-weekly/10233). Quando examino o HTML bruto do e-mail, ele parece estar formatado corretamente, e temos a configuração do Discourse `incoming email prefer htmls` ativada (o padrão).

Os principais problemas de formatação que vejo são:

1. Parágrafos dentro de tags LI não estão indentados
2. Há novas linhas ausentes após os cabeçalhos

> **E-mail bruto**
>
> ```plaintext
> Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133])
> by mail-receiver-stardestroyer03.localdomain (Postfix) with ESMTPS id 7E5221613D0
> for <nixos1+links@discoursemail.com>; Fri, 27 Nov 2020 16:11:19 +0000 (UTC)
> Received: by mail-il1-x133.google.com with SMTP id a19so5060269ilm.3
> for <nixos1+links@discoursemail.com>; Fri, 27 Nov 2020 08:11:19 -0800 (PST)
> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
> d=dev-si.20150623.gappssmtp.com; s=20150623;
> h=from:mime-version:date:message-id:subject:to;
> bh=kDWChQV280u+GWaWSpbLmUW2vuQTBCk5J3iZoEHn660=;
> b=TAyC0sDPCXFm5VRSOVHAZHv+X6qTmd6Z8LQjYeLo1ZXh5Xv3/dBNpsQOv+6yLmFD0h
> sNM00QhFoJEVGwAL7V0leXqurPVUydJRSndjNjcmE2zdDLYD0Mk+rNslEKPoaIJVBKnh
> 9K/GsruvtLh2+ih732ktvje8mPtcBfxb5CLZNnTgmae2b9B+vmJebU7BGubwokQWkd24
> /PG2fuXGonux0BYpHNME2IL11JFUt2zS9c2LsSfedIT2tP2Kg4QPH7Q2eo7RPhBqPt8O
> ftuUNvd71h+phMncHL5IEzLXT/lkJ54qNTwQpoOvB8ATDjWP8Z+hm8Sj+ANmOoBvLHgT
> IMXg==
> X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
> d=1e100.net; s=20161025;
> h=x-gm-message-state:from:mime-version:date:message-id:subject:to;
> bh=kDWChQV280u+GWaWSpbLmUW2vuQTBCk5J3iZoEHn660=;
> b=dor5nA/6xT6/jMgVJSJfzrHaDhCLP4aU3nEuAcpr9XzDwnCgvnWs3yULV+pqa3B9lg
> Z37Gwyfx113HrrKQAMwRel6Uh2mWRLYolqOQfDcou6eoOfUnQ00IjHL+8YggEFH8ROxC
> Ou1ThEl5E5GgiP4qoQfDcou6eoOfUnQ00IjHL+8YggEFH8ROxC
> 51khZIYxOmQ1dMA6bQHZSY/h/e/qq4bqEOsT7ZMW18VLYit8qy/CUJb6SamdU+YSeKRd
> 0+V/PcgJgev+/VoRUmYvqH+ihq89Koxk4parjgbMTDTgjjLho5wUVUPHRLiN9DZSsI2N
> rIRg==
> X-Gm-Message-State: AOAM530VvJMF2CbhtwVl3E8Rr6awT+TXUJFuoNH4c3A70v2xulTkBq32
> 48XtkD5EQBWG6wwoVoMrM0UTRgwqAJCUlU2aDBfqFa5oxtNmyA==
> X-Google-Smtp-Source: ABdhPJyDCTrLERvaHMzHuHp9jB2YvYE0SLEErWsxrVs5uyeaBO8cVZtkul+CNP+5P71NrO2mbACx/gsbZSsDTjV+3xM=
> X-Received: by 2002:a92:c64b:: with SMTP id 11mr7560388ill.224.1606493478415;
> Fri, 27 Nov 2020 08:11:18 -0800 (PST)
> Received: from 427071021612 named unknown by gmailapi.google.com with
> HTTPREST; Fri, 27 Nov 2020 11:11:18 -0500
> From: domen@dev.si
> Mime-Version: 1.0
> Date: Fri, 27 Nov 2020 11:11:17 -0500
> Message-ID: <CAMvcdZSt6iXGq6-f5oX6AiAPk4-1HqxuOAQO+2uG2eWCq854fw@mail.gmail.com>
> Subject: NixOS Weekly #09 - NixOS Weekly
> To: nixos1+links@discoursemail.com
> Content-Type: multipart/alternative; boundary="0000000000001d8d0105b518e9c5"
> 
> --0000000000001d8d0105b518e9c5
> Content-Type: text/plain; charset="UTF-8"
> 
> News Announcements
> 
> - Announcing Nixpkgs Database
> <https://kamadorueda.github.io/nixpkgs-db/#/about>
> 
> A database and search engine for the entire history of each package at
> Nixpkgs <https://github.com/nixos/nixpkgs>.
> 
> - Cachix: write access control for binary caches
> <https://blog.cachix.org/posts/2020-11-09-write-access-control-for-binary-caches/>
> 
> The trust of who created binary cache contents comes from who owns the
> private signing key.
> 
> This approach has a number of disadvantages when it comes to lifecycle in
> teams, so API tokens are now the default way to manage write access.
> 
> -
> 
> NixOS 21.03 Call for Release Manager
> <https://discourse.nixos.org/t/21-03-call-for-release-manager/10204>
> -
> 
> nixpkgs: Python 2.7 packages are no longer built
> <https://discourse.nixos.org/t/python-2-7-and-3-9-and-hydra-builds>
> -
> 
> nixpkgs: Haskell packages now follow nightly
> <https://discourse.nixos.org/t/new-ghc-default-version-8-10-2-package-versions-now-from-stackage-nightly>
> -
> 
> Mach-nix now has conda packages as a backend
> <https://discourse.nixos.org/t/mach-nix-create-python-environments-quick-and-easy/6858/86>
> -
> 
> Running NixOS on Pinecube
> <https://github.com/danielfullmer/pinecube-nixos>
> -
> 
> Our New Nix Deployment Tool: deploy-rs
> <https://serokell.io/blog/deploy-rs>
> 
> Tutorials
> 
> -
> 
> How to Setup Prometheus, Grafana and Loki on NixOS
> <https://christine.website/blog/prometheus-grafana-loki-nixos-2020-11-20>
> -
> 
> Deploying NixOS using Terraform
> <https://nix.dev/tutorials/deploying-nixos-using-terraform.html>
> -
> 
> Setting up i3 on Thinkpads running NixOS
> <https://www.srid.ca/i3-setup.html>
> -
> 
> How to use NixOS for lightweight integration tests
> <http://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html>
> -
> 
> Lightweight Linux VMs on NixOS <https://www.srid.ca/2012301.html>
> -
> 
> XMonad + Polybar on NixOS <https://gvolpe.com/blog/xmonad-polybar-nixos/>
> 
> Resources
> 
> -
> 
> Eight Months of NixOS <https://catgirl.ai/log/nixos-experience/>
> -
> 
> One week of NixOS <https://jae.moe/blog/2020/11/one-week-of-nixos/>
> -
> 
> Moving into NixOS
> <https://foo-dogsquared.github.io/blog/posts/moving-into-nixos/>
> -
> 
> Automatically OCR scanned PDFs in NixOS
> <https://dev.to/jwoudenberg/automatically-ocr-scanned-pdfs-in-nixos-25d>
> 
> Annotated code showing you how to automatically create searchable scans of
> all the documents you receive in the post.
> Jobs
> 
> -
> 
> Internal Tooling & SRE at NoRedInk - Nix, Haskell, k8s
> <https://www.noredink.com/job_post?gh_jid=2443611>
> -
> 
> DevOps Engineer (Munich or Remote)
> <https://genesis-jobs.personio.de/job/278290>
> 
> Contribute to NixOS Weekly Newsletter
> 
> This work would not be possible without the many contributions of the
> community.
> 
> You can help too! Create or comment on the pull request
> <https://github.com/NixOS/nixos-weekly/pulls> for the next edition or look
> at the issue tracker <https://github.com/NixOS/nixos-weekly/issues> to add
> other improvements.
> 
> --0000000000001d8d0105b518e9c5
> Content-Type: text/html; charset="UTF-8"
> 
> <h1>News</h1>
> <h2>Announcements</h2>
> <ul>
> <li><a href="https://kamadorueda.github.io/nixpkgs-db/#/about">Announcing Nixpkgs Database</a></li>
> </ul>
> <p>A database and search engine for the entire history of each package at <a href="https://github.com/nixos/nixpkgs">Nixpkgs</a>.</p>
> <ul>
> <li><a href="https://blog.cachix.org/posts/2020-11-09-write-access-control-for-binary-caches/">Cachix: write access control for binary caches</a></li>
> </ul>
> <p>The trust of who created binary cache contents comes from who owns the private signing key.</p>
> <p>This approach has a number of disadvantages when it comes to lifecycle in teams, so API tokens are now the default way to manage write access.</p>
> <ul>
> <li>
> <p><a href="https://discourse.nixos.org/t/21-03-call-for-release-manager/10204">NixOS 21.03 Call for Release Manager</a></p>
> </li>
> <li>
> <p><a href="https://discourse.nixos.org/t/python-2-7-and-3-9-and-hydra-builds">nixpkgs: Python 2.7 packages are no longer built</a></p>
> </li>
> <li>
> <p><a href="https://discourse.nixos.org/t/new-ghc-default-version-8-10-2-package-versions-now-from-stackage-nightly">nixpkgs: Haskell packages now follow nightly</a></p>
> </li>
> <li>
> <p><a href="https://discourse.nixos.org/t/mach-nix-create-python-environments-quick-and-easy/6858/86">Mach-nix now has conda packages as a backend</a></p>
> </li>
> <li>
> <p><a href="https://github.com/danielfullmer/pinecube-nixos">Running NixOS on Pinecube</a></p>
> </li>
> <li>
> <p><a href="https://serokell.io/blog/deploy-rs">Our New Nix Deployment Tool: deploy-rs</a></p>
> </li>
> </ul>
> <h2>Tutorials</h2>
> <ul>
> <li>
> <p><a href="https://christine.website/blog/prometheus-grafana-loki-nixos-2020-11-20">How to Setup Prometheus, Grafana and Loki on NixOS</a></p>
> </li>
> <li>
> <p><a href="https://nix.dev/tutorials/deploying-nixos-using-terraform.html">Deploying NixOS using Terraform</a></p>
> </li>
> <li>
> <p><a href="https://www.srid.ca/i3-setup.html">Setting up i3 on Thinkpads running NixOS</a></p>
> </li>
> <li>
> <p><a href="http://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html">How to use NixOS for lightweight integration tests</a></p>
> </li>
> <li>
> <p><a href="https://www.srid.ca/2012301.html">Lightweight Linux VMs on NixOS</a></p>
> </li>
> <li>
> <p><a href="https://gvolpe.com/blog/xmonad-polybar-nixos/">XMonad + Polybar on NixOS</a></p>
> </li>
> </ul>
> <h2>Resources</h2>
> <ul>
> <li>
> <p><a href="https://catgirl.ai/log/nixos-experience/">Eight Months of NixOS</a></p>
> </li>
> <li>
> <p><a href="https://jae.moe/blog/2020/11/one-week-of-nixos/">One week of NixOS</a></p>
> </li>
> <li>
> <p><a href="https://foo-dogsquared.github.io/blog/posts/moving-into-nixos/">Moving into NixOS</a></p>
> </li>
> <li>
> <p><a href="https://dev.to/jwoudenberg/automatically-ocr-scanned-pdfs-in-nixos-25d">Automatically OCR scanned PDFs in NixOS</a></p>
> </li>
> </ul>
> <p>Annotated code showing you how to automatically create searchable scans of all the documents you receive in the post.</p>
> <h2>Jobs</h2>
> <ul>
> <li>
> <p><a href="https://www.noredink.com/job_post?gh_jid=2443611">Internal Tooling &amp; SRE at NoRedInk - Nix, Haskell, k8s</a></p>
> </li>
> <li>
> <p><a href="https://genesis-jobs.personio.de/job/278290">DevOps Engineer (Munich or Remote)</a></p>
> </li>
> </ul>
> <h1>Contribute to NixOS Weekly Newsletter</h1>
> <p>This work would not be possible without the many contributions of the community.</p>
> <p>You can help too! Create or comment on the <a href="https://github.com/NixOS/nixos-weekly/pulls">pull request</a> for the next edition or look at the <a href="https://github.com/NixOS/nixos-weekly/issues">issue tracker</a> to add other improvements.</p>
> 
> --0000000000001d8d0105b518e9c5--
> 
> ```

> **Markdown gerado pelo Discourse**
>
> ```plaintext
> # News## Announcements- [Announcing Nixpkgs Database](https://kamadorueda.github.io/nixpkgs-db/#/about)
> 
> A database and search engine for the entire history of each package at [Nixpkgs](https://github.com/nixos/nixpkgs).
> 
> - [Cachix: write access control for binary caches](https://blog.cachix.org/posts/2020-11-09-write-access-control-for-binary-caches/)
> 
> The trust of who created binary cache contents comes from who owns the private signing key.
> 
> This approach has a number of disadvantages when it comes to lifecycle in teams, so API tokens are now the default way to manage write access.
> 
> - [NixOS 21.03 Call for Release Manager](https://discourse.nixos.org/t/21-03-call-for-release-manager/10204)
> 
> - [nixpkgs: Python 2.7 packages are no longer built](https://discourse.nixos.org/t/python-2-7-and-3-9-and-hydra-builds)
> 
> - [nixpkgs: Haskell packages now follow nightly](https://discourse.nixos.org/t/new-ghc-default-version-8-10-2-package-versions-now-from-stackage-nightly)
> 
> - [Mach-nix now has conda packages as a backend](https://discourse.nixos.org/t/mach-nix-create-python-environments-quick-and-easy/6858/86)
> 
> - [Running NixOS on Pinecube](https://github.com/danielfullmer/pinecube-nixos)
> 
> - [Our New Nix Deployment Tool: deploy-rs](https://serokell.io/blog/deploy-rs)
> 
> ## Tutorials- [How to Setup Prometheus, Grafana and Loki on NixOS](https://christine.website/blog/prometheus-grafana-loki-nixos-2020-11-20)
> 
> - [Deploying NixOS using Terraform](https://nix.dev/tutorials/deploying-nixos-using-terraform.html)
> 
> - [Setting up i3 on Thinkpads running NixOS](https://www.srid.ca/i3-setup.html)
> 
> - [How to use NixOS for lightweight integration tests](http://www.haskellforall.com/2020/11/how-to-use-nixos-for-lightweight.html)
> 
> - [Lightweight Linux VMs on NixOS](https://www.srid.ca/2012301.html)
> 
> - [XMonad + Polybar on NixOS](https://gvolpe.com/blog/xmonad-polybar-nixos/)
> 
> ## Resources- [Eight Months of NixOS](https://catgirl.ai/log/nixos-experience/)
> 
> - [One week of NixOS](https://jae.moe/blog/2020/11/one-week-of-nixos/)
> 
> - [Moving into NixOS](https://foo-dogsquared.github.io/blog/posts/moving-into-nixos/)
> 
> - [Automatically OCR scanned PDFs in NixOS](https://dev.to/jwoudenberg/automatically-ocr-scanned-pdfs-in-nixos-25d)
> 
> Annotated code showing you how to automatically create searchable scans of all the documents you receive in the post.
> 
> ## Jobs- [Internal Tooling & SRE at NoRedInk - Nix, Haskell, k8s](https://www.noredink.com/job_post?gh_jid=2443611)
> 
> - [DevOps Engineer (Munich or Remote)](https://genesis-jobs.personio.de/job/278290)
> 
> # Contribute to NixOS Weekly Newsletter
> 
> This work would not be possible without the many contributions of the community.
> 
> You can help too! Create or comment on the [pull request](https://github.com/NixOS/nixos-weekly/pulls) for the next edition or look at the [issue tracker](https://github.com/NixOS/nixos-weekly/issues) to add other improvements.
> 
> ```

Você poderia me dar algum conselho sobre como fazer com que os e-mails cheguem corretamente?

Atenciosamente,  
Ryan Mulligan

---

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [27 Novembro , 2020 19:58 UTC](https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518/2 "2020-11-27T19:58:18Z")

</div>

Acabei de examinar mais de perto o HTML e parece que talvez o primeiro problema seja um erro no HTML. A ausência de quebras de linha após os cabeçalhos ainda parece válida.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [27 Novembro , 2020 20:09 UTC](https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518/3 "2020-11-27T20:09:48Z")

</div>

Tenho uma correção a caminho.

---

<div class="post-metadata">

### Author: ![domen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/domen/32/155621_2.png) [@domen](https://meta.discourse.org/u/domen)
#### Post date: [21 Janeiro , 2021 12:05 UTC](https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518/5 "2021-01-21T12:05:41Z")

</div>

Sua correção já foi mesclada na master?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [21 Janeiro , 2021 13:44 UTC](https://meta.discourse.org/t/issues-with-html-to-markdown-converter-on-incoming-email/171518/6 "2021-01-21T13:44:35Z")

</div>

Não exatamente. Ainda estou trabalhando nisso.
