Skip to content

MSO conditional comments truncate table content in 3.10.1 #1590

@amureki

Description

@amureki

Hey there!
We discovered a regression in the new version of the library (3.10.1):
HTML content after MS Office conditional comments is truncated when inside a <table> element.

Reproduction

import markdown

html = """
<table>
<!--[if mso]>-->
<td>keep</td>
<!--<![endif]-->
<td>also keep</td>
</table>
"""

markdown.markdown(html)

Expected:

<table>
<!--[if mso]>-->
<td>keep</td>
<!--<![endif]-->
<td>also keep</td>
</table>

Actual:

<table>
</table>

Context

These are standard MS Office/Outlook conditional comments used in HTML emails for Outlook compatibility.

Regression

Works in 3.10, broken in 3.10.1.
I think, it was introduced in f925349

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedConfirmed bug report or approved feature request.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions