# Outlook 邮件回复会丢失编号列表后的所有内容

**URL:** <https://meta.discourse.org/t/reply-by-email-from-outlook-drops-everything-after-a-numbered-list/408194>\
**Category:** Bug\
**Tags:** email, email-in, fixed\
**Created:** [2026年七月21日 20:55 UTC](https://meta.discourse.org/t/reply-by-email-from-outlook-drops-everything-after-a-numbered-list/408194 "2026-07-21T20:55:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ryanturner](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@ryanturner](https://meta.discourse.org/u/ryanturner)\
**Post date:** [2026年七月21日 20:55 UTC](https://meta.discourse.org/t/reply-by-email-from-outlook-drops-everything-after-a-numbered-list/408194/1 "2026-07-21T20:55:02Z")

</div>

自托管，版本 2026.1.5（提交 2727e4d）。我们以邮件列表模式运行社区，并通过电子邮件接收回复。

一位成员使用 Outlook 回复了一封内容较长的帖子，但网站上显示并转发回邮件列表的副本在中间被截断了。从他们的第一个编号列表开始的所有内容都消失了。没有错误，日志中也没有任何记录，帖子只是在中途戛然而止。

起初让我感到困惑的是：同一封邮件中前面的项目符号列表（无序列表）都正常显示。只有编号列表被截断，以及其后的所有内容。

问题出在 `lib/email/receiver.rb` 中的 `extract_from_word` 方法。对于 Outlook/Word 邮件，它将 `.WordSection1` 中第一个既不是 `<p>` 也不是 `<ul>` 的子元素视为签名或转发消息的开头，并将其与之后的所有同级元素一起移除：

```ruby
elided =
doc.css(
  ".WordSection1 > :not(p):not(ul):first-of-type, .WordSection1 > :not(p):not(ul):first-of-type ~ *",
).remove

```

Outlook 将编号列表渲染为 `<ol>`，而选择器并未排除 `<ol>`。因此，编号列表是第一个“既不是 `<p>` 也不是 `<ul>`”的元素，接收器便在此处截断了邮件。项目符号列表（`<ul>`）被排除在外，这就是为什么它们能保留下来，而编号列表却被截断的原因。

复现步骤

1. 从 Outlook（桌面版）回复通知。写一段文字，然后是一个编号列表，再写一段文字。
2. 生成的帖子会保留编号列表之前的文本，并丢弃编号列表及其下方的所有内容。

触发此问题的最小 HTML 正文（可以轻松放入接收器规范中）：

```html
<div class=WordSection1>
  <p class=MsoNormal>Intro paragraph.</p>
  <p class=MsoNormal>Steps:</p>
  <ol><li>First</li><li>Second</li></ol>
  <p class=MsoNormal>This trailing paragraph disappears too.</p>
</div>

```

你最终只会得到前两个介绍段落。

该问题在 main 分支上仍然存在——选择器尚未更改。我首先搜索了 bug 类别，但没有发现此问题已被提交。

建议的修复方案

将 `<ol>` 视为与 `<ul>` 相同，因为编号列表是内容，而不是签名：

```ruby
".WordSection1 > :not(p):not(ul):not(ol):first-of-type, .WordSection1 > :not(p):not(ul):not(ol):first-of-type ~ *"

```

这样可以保留列表，同时仍然省略真正的签名/转发标记（表格、div、hr、图像）。如果有帮助，我很乐意提交一个包含测试邮件和失败规范的 PR。

---

_[View the full topic](https://meta.discourse.org/t/reply-by-email-from-outlook-drops-everything-after-a-numbered-list/408194)._
