Last modified: 2021-12-23 15:35

Supported Markup

mdc implements the markdown basics plus some few extensions. In contrast to the original markdown I am not aiming too much for HTML. (Instead I want the source to be readable.) Consequently, this page is short.

Inline Markup

mdc implements the following standard markups:

What Markup
italics _ or *
bold __ or **
code ` or ``
URLs enclose in < and >
links [ text ](url "title")
images ![ alt text ](url "title")
line break <BR> at the end of the line

Inserting HTML tags is not supported. Underscores inside words are kept as-is.

Block Elements

All block element markups start at the beginning of a line.

What Markup
Horizontal line Three or more -
Headings One to six # followed by the title
Numbered lists Digit followed by . indented by one blank
Lists A - or 1. indented one blank
Def. Lists An indented : with a : at the line end
List end A single . or - indented by up to 3 blanks
Code lines Indent with 4 blanks
Code blocks Start and end with a line of ```
Blockquotes Indent with >
Tables first non-white char is |; one line per row
CSS class %--- name assign style class name

Comments and Extensions

Lists (ordered an unordered) make all kinds of problems. First, it changes the indentation rules for lines: code line must now be 8 instead of 4 blanks (this is not implemented in mdc). The reason for this is that lines with 4 blanks indentation count to the list item. The second issue I have with lists is that it's unclear (I didn't find something about it) how they are ended.

That made me add a markdown extension: A dot . indented to at least one but not more that 3 blanks closes the lists up and including the dot's indentation level.

 - Item 1
 - Item 2
 An (for whatever reason) indented paragraph not belonging to
 Item 2.

You may also use a - instead of a .

Definition lists are another extension I have added. They start with an indented colon : which must be followed by a blank. To be recognized as definition term, the line must end with another :. The following paragraphs are translated into the definition data.

: markdown :
  A simple markup definition, which can be translated into HTML but
  that is also human-readable in a text editor.

Tables are supported but only on the very basic level:

To make tables look good in the plain-text they should be coded like this:

| **What**        | **Markup**                               |
| --------------- | ---------------------------------------- |
| Horizontal line | Three or more `-`                        |
| Headings        | One to six `#` followed by the title     |

Text is added to the previous row's cells, if the markdown line starts with : instead of |.

A preformatted code block begins and ends with three backticks ``` (or tilde chars ~~~) at the beginning of a line. Text inbetween is copied to the output without formatting or word wrap. If the backticks are followed by a (blank separated) underscore _ the text is formatted, that is, inline formatting rules are applied. Linebreaks are still unchanged.

The whole code block may be indented with blanks. The amount of block indentation is taken from the first line and removed from all following lines. This can be turned off by adding a single quote '.

Beginning a line with %--- name puts the following text into the CSS diversion of class name. The block ends when a line starting with %--- is found in the input.