Bug 1898892 - Use nsIDocumentEncoder.OutputFormatted as required by a Debug assert. r=#thunderbird-reviewers

I do not know why m-c requires using `OutputFormatted` in order to use
`OutputFormatFlowed`. To resolve the test fail, this fix is adding the
required flag. However, this is not really what I want, since
`OutputFormatted` translates `<b>` tags to `*` and `<i>` tags to `/`.

Will ask m-c if this requirement could be lifted.

See: https://searchfox.org/mozilla-central/rev/f967675ec87bb200b5b911b6fd0fb8c1e06c5167/dom/serializers/nsPlainTextSerializer.cpp#323-328

Differential Revision: https://phabricator.services.mozilla.com/D211660

--HG--
extra : amend_source : 391d4f20af554997a34414b7f5b3876532c29276
This commit is contained in:
John Bieling 2024-05-25 22:13:27 +02:00
Родитель 343706f6a7
Коммит fe64f21547
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -38,7 +38,7 @@ this.messengerUtilities = class extends ExtensionAPIPersistent {
if (options?.flowed) {
wrapWidth = 72;
flags |=
Ci.nsIDocumentEncoder.OutputWrap |
Ci.nsIDocumentEncoder.OutputFormatted |
Ci.nsIDocumentEncoder.OutputFormatFlowed;
}

Просмотреть файл

@ -197,7 +197,7 @@ add_task(async function test_convertToPlainText() {
// Flowed output is wrapping lines to 72 chars length. The enforced
// line breaks have a trailing space, allowing the client to reflow
// the text and only honor the line breaks added by the user.
expectedPlain: `This is flowed html content,
expectedPlain: `This is /flowed/ html content,
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet