Closed syntaxsurge closed 10 months ago
The lists should be covered by the cuddled-lists
extra, but I'm not sure why the table isn't recognised. I'll look into that
The lists should be covered by the
cuddled-lists
extra, but I'm not sure why the table isn't recognised. I'll look into that
Thanks, it is working now. The reason why the table did not work because I forgot to add extras=['tables'].
Description
When using the
markdown2
library to convert Markdown content to HTML, I am encountering an issue where certain Markdown elements, specifically lists (both ordered and unordered) and tables, are not converting correctly unless they are preceded by two line breaks. This issue poses a significant challenge as the content I am working with is dynamic, and preprocessing it to insert additional line breaks disrupts the original formatting and flow of the text.Steps to Reproduce
The issue can be reproduced with the following Markdown examples:
Ordered List:
Expected Output: An HTML-converted ordered list. Actual Output: The list items are not recognized as part of an ordered list due to the absence of an additional line break before the list starts.
Unordered List:
Expected Output: An HTML-converted unordered list. Actual Output: The list items are not recognized as part of an unordered list due to the same issue with line breaks.
Tables:
Expected Output: An HTML-converted table. Actual Output: The table is not properly recognized and converted due to the lack of an additional line break before it begins.
Expected Behavior
The
markdown2
library should ideally convert Markdown elements like lists and tables to their corresponding HTML counterparts without requiring two line breaks before them. This behavior is crucial for maintaining the integrity of dynamically generated content where additional line breaks can disrupt the structure and readability.Additional Context
This issue significantly affects the processing of dynamic content where manual insertion of line breaks is not feasible or disrupts the intended formatting. A solution or workaround that enables the
markdown2
library to recognize and convert these elements with single line breaks would be greatly appreciated.Thank you for your attention to this matter.