| | @@ -1,10 +1,10 @@ |
| 1 | 1 | # Markdown formatting rules |
| 2 | 2 | |
| 3 | | -In addition to its native Wiki formatting syntax, Fossil supports Markdown syntax as specified by |
| 4 | | -[John Gruber's original Markdown implementation](http://daringfireball.net/projects/markdown/). |
| 5 | | -For lots of examples - not repeated here - please refer to its |
| 3 | +In addition to its native Wiki formatting syntax, Fossil supports Markdown syntax as specified by |
| 4 | +[John Gruber's original Markdown implementation](http://daringfireball.net/projects/markdown/). |
| 5 | +For lots of examples - not repeated here - please refer to its |
| 6 | 6 | [syntax description](http://daringfireball.net/projects/markdown/syntax), of which the page you |
| 7 | 7 | are reading is an extract. |
| 8 | 8 | |
| 9 | 9 | This page itself uses Markdown formatting. |
| 10 | 10 | |
| | @@ -12,18 +12,18 @@ |
| 12 | 12 | |
| 13 | 13 | - Block elements |
| 14 | 14 | |
| 15 | 15 | * A **paragraph** is a group of consecutive lines. Paragraphs are separated by blank lines. |
| 16 | 16 | |
| 17 | | - * A **Header** is a line of text underlined with equal signs or hyphens, or prefixed by a |
| 17 | + * A **Header** is a line of text underlined with equal signs or hyphens, or prefixed by a |
| 18 | 18 | number of hash marks. |
| 19 | 19 | |
| 20 | 20 | * **Block quotes** are blocks of text prefixed by '>'. |
| 21 | 21 | |
| 22 | 22 | * **Ordered list** items are prefixed by a number and a period. **Unordered list** items |
| 23 | 23 | are prefixed by a hyphen, asterisk or plus sign. Prefix and item text are separated by |
| 24 | | - whitespace. |
| 24 | + whitespace. |
| 25 | 25 | |
| 26 | 26 | * **Code blocks** are formed by lines of text (possibly including empty lines) prefixed by |
| 27 | 27 | at least 4 spaces or a tab. |
| 28 | 28 | |
| 29 | 29 | * A **horizontal rule** is a line consisting of 3 or more asterisks, hyphens or underscores, |
| | @@ -34,26 +34,26 @@ |
| 34 | 34 | * 3 types of **links** exist: |
| 35 | 35 | |
| 36 | 36 | - **automatic links** are URLs or email addresses enclosed in angle brackets |
| 37 | 37 | ('<' and '>'), and are displayed as such. |
| 38 | 38 | |
| 39 | | - - **inline links** consist of the displayed link text in square brackets ('[' and ']'), |
| 40 | | - followed by the link target in parentheses. |
| 39 | + - **inline links** consist of the displayed link text in square brackets ('[' and ']'), |
| 40 | + followed by the link target in parentheses. |
| 41 | 41 | |
| 42 | | - - **reference links** separate _link instance_ from _link definition_. A link instance |
| 43 | | - consists of the displayed link text in square brackets, followed by a link definition name |
| 44 | | - in square brackets. |
| 42 | + - **reference links** separate _link instance_ from _link definition_. A link instance |
| 43 | + consists of the displayed link text in square brackets, followed by a link definition name |
| 44 | + in square brackets. |
| 45 | 45 | The corresponding link definition can occur anywhere on the page, and consists |
| 46 | | - of the link definition name in square brackets followed by a colon, whitespace and the |
| 46 | + of the link definition name in square brackets followed by a colon, whitespace and the |
| 47 | 47 | link target. |
| 48 | 48 | |
| 49 | 49 | * **Emphasis** can be given by wrapping text in one or two asterisks or underscores - use |
| 50 | 50 | one for HTML `<em>`, and two for `<strong>` emphasis. |
| 51 | 51 | |
| 52 | 52 | * A **code span** is text wrapped in backticks ('`'). |
| 53 | 53 | |
| 54 | | - * **Images** use a syntax much like inline or reference links, but with alt attribute text |
| 54 | + * **Images** use a syntax much like inline or reference links, but with alt attribute text |
| 55 | 55 | ('img alt=...') instead of link text, and the first pair of square |
| 56 | 56 | brackets in an image instance prefixed by an exclamation mark. |
| 57 | 57 | |
| 58 | 58 | - **Inline HTML** is mostly interpreted automatically. |
| 59 | 59 | |
| | @@ -88,11 +88,11 @@ |
| 88 | 88 | ### Block quotes |
| 89 | 89 | |
| 90 | 90 | Not every line in a paragraph needs to be prefixed by '>' in order to make it a block quote, |
| 91 | 91 | only the first line. |
| 92 | 92 | |
| 93 | | -Block quoted paragraphs can be nested by using multiple '>' characters as prefix. |
| 93 | +Block quoted paragraphs can be nested by using multiple '>' characters as prefix. |
| 94 | 94 | |
| 95 | 95 | Within a block quote, Markdown formatting (e.g. lists, emphasis) still works as normal. |
| 96 | 96 | |
| 97 | 97 | ### Lists |
| 98 | 98 | |
| | @@ -99,20 +99,20 @@ |
| 99 | 99 | A list item prefix need not occur first on its line; up to 3 leading spaces are allowed |
| 100 | 100 | (4 spaces would make a code block out of the following text). |
| 101 | 101 | |
| 102 | 102 | For unordered lists, asterisks, hyphens and plus signs can be used interchangeably. |
| 103 | 103 | |
| 104 | | -For ordered lists, arbitrary numbers can be used as part of an item prefix; the items will be |
| 105 | | -renumbered during rendering. However, future implementations may demand that the number used |
| 104 | +For ordered lists, arbitrary numbers can be used as part of an item prefix; the items will be |
| 105 | +renumbered during rendering. However, future implementations may demand that the number used |
| 106 | 106 | for the first item in a list indicates an offset to be used for subsequent items. |
| 107 | 107 | |
| 108 | 108 | For list items spanning multiple lines, subsequent lines can be indented using an arbitrary amount |
| 109 | 109 | of whitespace. |
| 110 | 110 | |
| 111 | 111 | List items will be wrapped in HTML `<p>` tags if they are separated by blank lines. |
| 112 | 112 | |
| 113 | | -A list item may span multiple paragraphs. At least the first line of each such paragraph must |
| 113 | +A list item may span multiple paragraphs. At least the first line of each such paragraph must |
| 114 | 114 | be indented using at least 4 spaces or a tab character. |
| 115 | 115 | |
| 116 | 116 | Block quotes within list items must have their '>' delimiters indented using 4 up to 7 spaces. |
| 117 | 117 | |
| 118 | 118 | Code blocks within list items need to be indented _twice_, that is, using 8 spaces or 2 tab |
| | @@ -131,31 +131,31 @@ |
| 131 | 131 | |
| 132 | 132 | ### Links |
| 133 | 133 | |
| 134 | 134 | #### Automatic links |
| 135 | 135 | |
| 136 | | -When rendering automatic links to email addresses, HTML encoding obfuscation is used to |
| 136 | +When rendering automatic links to email addresses, HTML encoding obfuscation is used to |
| 137 | 137 | prevent some spambots from harvesting. |
| 138 | 138 | |
| 139 | 139 | #### Inline links |
| 140 | 140 | |
| 141 | 141 | Links to resources on the same server can use relative paths (i.e. can start with a '/'). |
| 142 | 142 | |
| 143 | | -An optional title for the link (e.g. to have mouseover text in the browser) may be given behind |
| 144 | | -the link target but within the parentheses, in single and double quotes, and separated from the |
| 145 | | -link target by whitespace. |
| 143 | +An optional title for the link (e.g. to have mouseover text in the browser) may be given behind |
| 144 | +the link target but within the parentheses, in single and double quotes, and separated from the |
| 145 | +link target by whitespace. |
| 146 | 146 | |
| 147 | 147 | #### Reference links |
| 148 | 148 | |
| 149 | | -> Each reference link consists of |
| 149 | +> Each reference link consists of |
| 150 | 150 | > |
| 151 | 151 | > - one or more _link instances_ at appropriate locations in the page text |
| 152 | 152 | > - a single _link definition_ at an arbitrary location on the page |
| 153 | | -> |
| 153 | +> |
| 154 | 154 | > During rendering, each link instance is resolved, and the corresponding definition is |
| 155 | 155 | > filled in. No separate link definition clauses occur in the rendered output. |
| 156 | | -> |
| 156 | +> |
| 157 | 157 | > There are 3 fields involved in link instances and definitions: |
| 158 | 158 | > |
| 159 | 159 | > - link text (i.e. the text that is displayed at the resulting link) |
| 160 | 160 | > - link definition name (i.e. an unique ID binding link instances to link definition) |
| 161 | 161 | > - link target (a target URL for the link) |
| | @@ -197,11 +197,11 @@ |
| 197 | 197 | ### Code spans |
| 198 | 198 | |
| 199 | 199 | To include a literal backtick character in a code span, use multiple backticks as opening and |
| 200 | 200 | closing delimiters. |
| 201 | 201 | |
| 202 | | -Whitespace may exist immediately after the opening delimiter and before the closing delimiter |
| 202 | +Whitespace may exist immediately after the opening delimiter and before the closing delimiter |
| 203 | 203 | of a code span, to allow for code fragments starting or ending with a backtick. |
| 204 | 204 | |
| 205 | 205 | Within a code span - like within a code block - angle brackets and ampersands are automatically encoded to make including |
| 206 | 206 | HTML fragments easier. |
| 207 | 207 | |
| | @@ -209,17 +209,17 @@ |
| 209 | 209 | |
| 210 | 210 | If necessary, HTML must be used to specify image dimensions. Markdown has no provision for this. |
| 211 | 211 | |
| 212 | 212 | ### Inline HTML |
| 213 | 213 | |
| 214 | | -Start and end tags of |
| 214 | +Start and end tags of |
| 215 | 215 | a HTML block level construct (`<div>`, `<table>` etc) must be separated from surrounding |
| 216 | 216 | context using blank lines, and must both occur at the start of a line. |
| 217 | 217 | |
| 218 | 218 | No extra unwanted `<p>` HTML tags are added around HTML block level tags. |
| 219 | 219 | |
| 220 | | -Markdown formatting within HTML block level tags is not processed; however, formatting within |
| 220 | +Markdown formatting within HTML block level tags is not processed; however, formatting within |
| 221 | 221 | span level tags (e.g. `<mark>`) is processed normally. |
| 222 | 222 | |
| 223 | 223 | ### Escaping Markdown punctuation |
| 224 | 224 | |
| 225 | 225 | The following punctuation characters can be escaped using backslash: |
| 226 | 226 | |