Only ATX-style headings are supported in md-toc.
The code used in md-toc is a reverse engineering of the behavour described in the following:
The escape character
\ will be left as-is since they are parsed by
Github’s markdown parser already:
A line ending character is
U+000A or the
\r\n if combined).
Everything following those characters is ignored.
This has also the benefit to automatically remove
the trailing newline or carriage return at the end of each line. This also
includes ATX headers with line endings only as main content, such as
#\r. See also:
Every other rule for ATX headings is applied.
Line endings are generically
\r characters. See: