You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Commonmark, there are two types of lists: loose and tight. Loose lists are lists in which the content of each list item is wrapped in a paragraph. Tight lists, on the other hand, are lists in which the content of each list item is not wrapped in a paragraph.
Here's an example of a loose list in Commonmark:
- list1
- list1
- list2
- list2
The resulting list will be the same as without the blank line, as it is ignored if a list is tight or loose when generating the PDF Elements
Solution
To achieve separate lists, there are a few solutions. One is to use an empty HTML comment:
- list1
- list1
<!---->- list2
- list2
By using an empty HTML comment, you create a break between the two lists, which Commonmark then interprets as separate lists.
It's important to note that Commonmark has strict rules for formatting lists, which are designed to ensure consistency and predictability across different platforms. Understanding these rules and how to format lists correctly can help you produce clean, well-formatted documents.
If you'd like to learn more about Commonmark and how to format lists correctly, you can refer to the Commonmark specification, which can be found here: https://spec.commonmark.org/0.30/#loose
In conclusion, when writing with Commonmark, be mindful of the difference between loose and tight lists and how to format them correctly. By following the guidelines in the Commonmark specification, you can ensure that your documents are clean, well-formatted, and easy to read.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problems with multiple lists in Commonmark
In Commonmark, there are two types of lists: loose and tight. Loose lists are lists in which the content of each list item is wrapped in a paragraph. Tight lists, on the other hand, are lists in which the content of each list item is not wrapped in a paragraph.
Here's an example of a loose list in Commonmark:
The resulting list will be the same as without the blank line, as it is ignored if a list is tight or loose when generating the PDF Elements
Solution
To achieve separate lists, there are a few solutions. One is to use an empty HTML comment:
By using an empty HTML comment, you create a break between the two lists, which Commonmark then interprets as separate lists.
It's important to note that Commonmark has strict rules for formatting lists, which are designed to ensure consistency and predictability across different platforms. Understanding these rules and how to format lists correctly can help you produce clean, well-formatted documents.
If you'd like to learn more about Commonmark and how to format lists correctly, you can refer to the Commonmark specification, which can be found here: https://spec.commonmark.org/0.30/#loose
In conclusion, when writing with Commonmark, be mindful of the difference between loose and tight lists and how to format them correctly. By following the guidelines in the Commonmark specification, you can ensure that your documents are clean, well-formatted, and easy to read.
Beta Was this translation helpful? Give feedback.
All reactions