TERMINAL MARKDOWN


For the internals, all that's going on is a substitution of certain characters with certain escape sequences.

The first time the programs sees a special character, it substitutes it for an escape sequence according to the following:

    Special Character       Escape Sequence         Style to Begin
    #                       \e[1m                   bold
    ~                       \e[2m                   dim
    *                       \e[3m                   italic
    _                       \e[4m                   underline
    @                       \e[5m                   blink
    $                       \e[7m                   inverted
    `                       \e[8m                   hidden
    %                       \e[9m                   strikethrough
    ^x                      \e[30m  - \e[36m        foreground
    ^X                      \e[91m  - \e[97m        light foreground
    |x                      \e[40m  - \e[46m        background
    |X                      \e[101m - \e[107m       light background

This escape sequence tells the terminal to start the associated style.

The next time the special character is seen, this substitution takes place:

    Special Character       Escape Sequence         Style to End
    #                       \e[22m                  bold
    ~                       \e[22m                  dim
    *                       \e[23m                  italic
    _                       \e[24m                  underline
    @                       \e[25m                  blink
    $                       \e[27m                  inverted
    `                       \e[28m                  hidden
    %                       \e[29m                  strikethrough
    ^                       \e[39m                  foreground
    |                       \e[49m                  background

This escape sequence tells the terminal to end the associated style.

A backslash skips over the interpretation of the susbsequent character.