Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSO conditional comments #525

Closed
stianolsen opened this issue Feb 1, 2024 · 2 comments
Closed

MSO conditional comments #525

stianolsen opened this issue Feb 1, 2024 · 2 comments

Comments

@stianolsen
Copy link

In one of the later releases, there was a change which made some characters like < and >, be encoded if they were found within a HTML comment.
We experience that this breaks MSO conditional comments, which uses HTML comment to "hide" the Outlook specific parts.
For example this:

<h1>Hello</h1><!-- Normal comment --><!--[if mso]> 
<table><tr><td>
       <p>This information will display only in Microsoft Outlook.</p>
   </td></tr></table>
<![endif]-->

becomes the following after being sanitized:

<h1>Hello</h1><!-- Normal comment --><!--[if mso]&gt; 
&lt;table&gt;&lt;tr&gt;&lt;td&gt;
       &lt;p&gt;This information will display only in Microsoft Outlook.&lt;/p&gt;
   &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;![endif]-->

and Outlook does not seem to understand when the HTML within the conditional comment is encoded.
Is there anything that can be done with this?

@mganss mganss closed this as completed in 9254a13 Feb 1, 2024
@mganss
Copy link
Owner

mganss commented Feb 1, 2024

I've created a property EncodeComment to customize the encoding of comments similar to what has been done for #511. Watch out for possible bypasses if you override the default behavior (see GHSA-43cp-6p3q-2pc4).

@mganss
Copy link
Owner

mganss commented Feb 1, 2024

Releases are 8.0.838 and 8.1.839-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants