OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
686 stars 95 forks source link

Body content style changed after inserting html from Outlook add-in on Mac #1605

Closed liwei118 closed 3 years ago

liwei118 commented 3 years ago

Expected Behavior

After inserting html to the top of mail body content from Outlook add-in on Mac, part of the beginning of original body content is not changed.

Current Behavior

After inserting html to the top of mail body content from Outlook add-in on Mac, part of the beginning of original body content is wrapped with tag.

Steps to Reproduce, or Live Example

        Office.context.mailbox.item.body.setAsync(
          `
          <div style='margin-bottom:10.0pt;margin-top:5.0pt;'>
          <!--[if mso]><style type="text/css">body {color: #000000;}</style><![endif]-->
          <table cellspacing='0' cellpadding='0' style='border:solid #F4F4F4 1.0pt;padding:12pt;font-family: Segoe UI;'>
          <tbody>
            <tr>
              <td width='69' valign='top'>
              <img width='54' height='54' src="https://img.png" crossorigin="anonymous">
              </td>
              <td width='1897' valign='top' >
              <p><b>Starbucks</b></p>
              <p style='margin-top:8.0pt'>Hi! wei ordered coffee for you. If you want to change your coffee option or decline the coffee, click
              <b><a href="https://1213#}">Here</a></b> before 8AM of meeting day.</p>
              <p style='margin-top:15.0pt;'>Tips: You can also s.</p>
              </td>
            </tr>
            </tbody>
          </table> 
          </div>
          `+ newDom.outerHTML , { coercionType: Office.CoercionType.Html }
        )

Context

Your Environment

Useful logs

image

exextoc commented 3 years ago

Is this issue happening on both Mac and Windows?In Mac is it happening on old UI or new UI? I tried reproducing this issue on Mac but was not able to reproduce it .Can you please elaborate the repro steps with sample code for both scenario?

liwei118 commented 3 years ago

old UI
repro steps: https://21vms-my.sharepoint.cn/:v:/g/personal/v-rehong_21vms_partner_onmschina_cn/EVDwczSMO5NFpe5r42LRnmkBYo6eaIXjglC0Ss-_UFOC7w?e=STYzWr

exextoc commented 3 years ago

We tried to reproduce this issue with sample code shared above on Mac(Old UI) and windows but could not able to reproduce this issue .Can you please share the manifest which you are using to reproduce this issue?

liwei118 commented 3 years ago

manifest: https://sbux-outlook.chinacloudsites.cn/manifest.prod.xml

exextoc commented 3 years ago

Manifest which you shared require QR Code to login .Can you please share the exact sample code in Add-in which you are running .I tried with sample code shared above but newDom was not defined in that sample code and we are not able to run it .

liwei118 commented 3 years ago

You may scan the QR Code and click "link" button on the page it opens, then you should be able to test. It is just a demo, the login process will only store your email address and a randomly generated GUID. thanks.

exextoc commented 3 years ago

We are able to repro the issue. Thanks for reporting it. It has been put on our backlog. We unfortunately have no timelines to share at this point.

exextoc commented 3 years ago

To help us repro in Outlook for Windows, could you provide the Outlook version number (I see Outlook 2019 is mentioned above, but without the full version number).

In addition, could you update the repro steps with what the value for newDom should be? Being able to reproduce the issue outside of your add-in will help us fix the issue. Thanks.

liwei118 commented 3 years ago

verison:

815b62c881ea4c4839d26ca6b48a5c1

36204d42-1d4c-4c9b-b533-b84a62c04a9e

exextoc commented 3 years ago

For win-32 Outlook, we were unable to repro the bug you are seeing. Are you reproing this issue in Outlook win-32? If so, can you confirm the build of Outlook win-32 you are seeing this issue on? Are you seeing this on Version 2101, Build 16.0.13628.20274 as per your screenshot or on Outlook 2019?

ghost commented 3 years ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

ghost commented 3 years ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.