executablebooks / mdformat

CommonMark compliant Markdown formatter
https://mdformat.rtfd.io
MIT License
439 stars 46 forks source link

Support pandoc ::: #361

Closed Freed-Wu closed 2 years ago

Freed-Wu commented 2 years ago

Context

pandoc has a syntax :::

   Extension: fenced_divs
       Allow  special fenced syntax for native Div blocks.  A Div starts with a fence containing at least three consecutive colons plus some attributes.  The attributes may optionally be fol‐
       lowed by another string of consecutive colons.  The attribute syntax is exactly as in fenced code blocks (see Extension: fenced_code_attributes).  As with fenced code blocks,  one  can
       use  either  attributes in curly braces or a single unbraced word, which will be treated as a class name.  The Div ends with another line containing a string of at least three consecu‐
       tive colons.  The fenced Div should be separated by blank lines from preceding and following blocks.

       Example:

              ::::: {#special .sidebar}
              Here is a paragraph.

              And another.
              :::::

       Fenced divs can be nested.  Opening fences are distinguished because they must have attributes:

              ::: Warning ::::::
              This is a warning.

              ::: Danger
              This is a warning within a warning.
              :::
              ::::::::::::::::::

       Fences without attributes are always closing fences.  Unlike with fenced code blocks, the number of colons in the closing fence need not match the number in the opening fence.   Howev‐
       er, it can be helpful for visual clarity to use fences of different lengths to distinguish nested divs from their parents.

However, mdformat always change ::: to \:::.

Proposal

No response

Tasks and updates

No response

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

hukkin commented 2 years ago

The colon fence syntax is not included in CommonMark so this belongs in a plugin.

Related issue: https://github.com/executablebooks/mdformat-myst/issues/13

Freed-Wu commented 2 years ago

This issue is a repetition of https://github.com/executablebooks/mdformat-myst/issues/13. Close.