Repository navigation
Conversation
|
✅ DCO Check Passed Thanks @wfatih, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The email backend now passes CI safety: no concern found. A maintainer must still approve CI. The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at a862179a26. It read the code and did not run it.
I verified that setting image_placeholder="" in EmailDocumentBackend._get_body_paragraphs prevents placeholder paragraphs in HTML email conversions without altering public export APIs or other backends.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Hi @wfatih, thank you for this pull request. It has a merge conflict with git fetch upstream
git rebase upstream/main
# resolve the conflicts, then:
git push --force-with-leaseWe can continue with the review and CI after that. |
The HTML body is converted to Markdown and split into plain text paragraphs. The Markdown export writes "<!-- image -->" for each picture, so an image in the HTML body became a body paragraph with that literal text. Export the Markdown without an image placeholder. Signed-off-by: wfatih <ckrfth.s@gmail.com>
a862179 to
26f6184
Compare
|
Rebased on The change is still that one argument plus the regression test. The test fails without it ( |
For an HTML-only email,
EmailDocumentBackendconverts the HTML part with the HTML backend, exports it to Markdown and splits the Markdown into plain text paragraphs. The Markdown export writes<!-- image -->for every picture, so each<img>in the body turns into a paragraph with that literal text:On
mainthe body texts are["Hello", "<!-- image -->", "Bye"], and the Markdown of the email shows a visible<!-- image -->line, because text items are escaped on export. The same happens for an image in a table cell (| <!-- image --> | cell |) and in a<figure>. Logos in signatures and newsletters are a common case.This passes
image_placeholder=""to thatexport_to_markdown()call. The empty paragraph that is left is already dropped by_split_paragraphs(), and alt text and figure captions are kept as before.The new test converts the email above and checks that the body is
["Hello", "Bye"]and that the Markdown has no image placeholder. It fails onmainand passes with this change.tests/test_backend_email.pypasses (28 passed). The email tests have no groundtruth files, and none of the sample emails has an image.Checklist:
Review evidence:
<p>Hello</p><img src="cid:logo"><p>Bye</p>gives the body textsHello,<!-- image -->,Bye; the Markdown export shows<!-- image -->.Hello,Bye. Withalt="Logo"the alt text is still kept (Hello,Logo,Bye).pytest tests/test_backend_email.py: 28 passed. The new test fails onmain(1 failed, 27 passed).pytest tests/test_input_doc.py -k "email or eml or msg": 3 passed.ruff checkandruff format --checkpass on the changed files.