This document has not been approved by any group yet. The intent is to produce a strawmann document which can be used by the Markdown Community Group for defining what should be in a Markdown Specification.
Markdown is a text syntax created by John Gruber. etc. The content of the markup defined in this document is based on the initial Markdown Syntax as defined by John Gruber. The document might address syntax extension later on.
Define what/who implements the specification.
An EOL sequence consists of all characters and character sequences which can indicate the end of a line of input in a Markdown file.
An EOL sequence is defined as any of the following character sequences:
Should all Unicode characters considered to mean the end of the line be recognized? (see Wikipedia Newline article)
As far as I can tell, embedding different EOL characters in a single text document is not doable by me. I've created separate files to test, but that leaves us in the cold re: example text for this definition. I've included tests for each EOL (to make sure they are detected properly).
The output will be dependent on the block-level element being processed. See (list of block-elements and cross-referenctial anchor tags goes here) for more information.
For purposes of illustration, all the tests above should result in the following (identical) output.
These lines all end with end of line (EOL) sequences.
Seriously, they really do.
If you don't believe me: HEX EDIT!
A standalone paragraph is a unit of text on one or more contiguous lines. Authors can use 0 to 3 leading spaces and 1 trailing space.
This is a paragraph on a single line. This is another paragraph but on multiple lines. This is another way to create paragraphs with leading spaces.
A paragraph starts with 0 to 3 spaces (U+0020) followed by any characters, except the following characters *
(U+002A), -
(U+002D), +
(U+002B), >
(U+003E).
A paragraph ends with an EOL sequence followed by:
Should a parser remove the leading characters spaces.
To test tabs at the ends of a carriage return. See paragraph-trailing-tab.md test.
What is happening to a multiline paragraph when converted to HTML? normalize as a long line, kept as is with the carriage return? What about eventual leading and trailing spaces.
An HTML producer MUST output a P
element start tag followed by the content and MUST end with the P
element end tag.
Addressing the trailing/leading space characters in the processing or in the HTML output. Maybe better in the processing section to be able to produce in more than one format.
A line break is a way for authors to break a paragraph in the middle. Authors can use two trailing spaces and a return at the end of a line to insert a line break in a paragraph.
This is a paragraph␠␠ with an effective line break.
A line break is created when there are two trailing spaces characters (U+0020) followed by an EOL sequence.
To test what is happening with 3 or more trailing spaces.
To test what is happening when this is the end of the paragraph. Should it be removed or kept.
An HTML producer MUST output a BR
element.
A heading is a string of text for marking up headings with 1 to 6 levels. The heading must be on one and only one line. It must not have any leading space characters. There are 3 ways of marking up headings.
#
) at the beginning of the line followed by 0 or 1 space and the heading string. 1 hash sign for a level 1 heading to 6 hash signs for a level 6 heading.#
.=
) of the same length than the heading.-
) of the same length than the heading.# Heading level 1 ## Heading level 2 ### Heading level 3 #### Heading level 4 ##### Heading level 5 ###### Heading level 6 # Heading level 1 # ## Heading level 2 ## ### Heading level 3 ### #### Heading level 4 #### ##### Heading level 5 ##### ###### Heading level 6 ###### Heading level 1 =============== Heading level 2 ---------------
.
trailing hash signs are not significant. This has to be explained clearly in the processing part.
leading spaces are forbidden. To check.
Is the length of the undeline string (=, -) significant. To check. Seems not.
Verify the combination of # and underline markup.
What should be the output
Reserved characters are used for marking up a markdown prose in some circumstances. It includes backtick `
, asterisk *
,
underscore _
, curly braces
{}
code>, square brackets[]
, parentheses ()
, hash mark #
, plus sign +
, minus sign (hyphen) -
, dot .
, exclamation mark !
. Their behavior is dependent of the position in the text. Authors can escape these characters with a backslash character (\
)
\\ backslash \` backtick \* asterisk \_ underscore \{\} curly braces \[\] square brackets \(\) parentheses \# hash mark \+ plus sign \- minus sign (hyphen) \. dot \! exclamation mark
How a parser should process the feature.@describe the step and the unicode character.
Describe precisely when the characters is not escaped.
Tests Needed for different circumstances.
The producer tool must output the reserved characters as it is defined.
An extension filename is a common way to identify a file on a Operating System and for authoring tools. Currently there are a number of extensions which have been used in the wild for handling markdown documents. Here is a list of some of these
Should there be only one normative extension filename for everyone to use? And make a note for deprecating the others as parseable but not conformant for producing tools.
Authors and authoring tools are encouraged to use a fixed-width font for editing markdown document. It will be a lot easier to read and write.
The editor would like to thank the following persons for contributing and helping in creating this document