├── .gitignore ├── Jakefile ├── LICENSE ├── README.md ├── helpers ├── example.textile ├── markdown-corrected.pegc ├── markdown.pegc └── markdown.peghs ├── markdown.pegjs ├── parser-defs.js ├── test-mdown-parser-with-node.js └── test ├── manual ├── all-types-links.md ├── big.md ├── bom.md ├── complex-bquotes.md ├── complex-lists.md ├── empty.md ├── from-gotchas-plain.md ├── from-gotchas.md ├── github-flavored-markdown.md ├── huge.md ├── links.md ├── no_bom.md ├── positions-tests.md ├── progressing.md ├── single-list-test.md ├── spaces.md ├── spacesnewlines.md └── word.md ├── mdtest1.1 ├── License.text ├── Markdown.mdtest │ ├── Amps and angle encoding.text │ ├── Amps and angle encoding.xhtml │ ├── Auto links.text │ ├── Auto links.xhtml │ ├── Backslash escapes.text │ ├── Backslash escapes.xhtml │ ├── Blockquotes with code blocks.text │ ├── Blockquotes with code blocks.xhtml │ ├── Code Blocks.text │ ├── Code Blocks.xhtml │ ├── Code Spans.text │ ├── Code Spans.xhtml │ ├── Hard-wrapped paragraphs with list-like lines.text │ ├── Hard-wrapped paragraphs with list-like lines.xhtml │ ├── Horizontal rules.text │ ├── Horizontal rules.xhtml │ ├── Images.text │ ├── Images.xhtml │ ├── Inline HTML (Advanced).text │ ├── Inline HTML (Advanced).xhtml │ ├── Inline HTML (Simple).html │ ├── Inline HTML (Simple).text │ ├── Inline HTML comments.html │ ├── Inline HTML comments.text │ ├── Links, inline style.text │ ├── Links, inline style.xhtml │ ├── Links, reference style.text │ ├── Links, reference style.xhtml │ ├── Links, shortcut references.text │ ├── Links, shortcut references.xhtml │ ├── Literal quotes in titles.text │ ├── Literal quotes in titles.xhtml │ ├── Markdown Documentation - Basics.text │ ├── Markdown Documentation - Basics.xhtml │ ├── Markdown Documentation - Syntax.text │ ├── Markdown Documentation - Syntax.xhtml │ ├── Nested blockquotes.text │ ├── Nested blockquotes.xhtml │ ├── Ordered and unordered lists.text │ ├── Ordered and unordered lists.xhtml │ ├── Strong and em together.text │ ├── Strong and em together.xhtml │ ├── Tabs.text │ ├── Tabs.xhtml │ ├── Tidyness.text │ └── Tidyness.xhtml ├── PHP Markdown Extra.mdtest │ ├── Abbr.text │ ├── Abbr.xhtml │ ├── Definition Lists.text │ ├── Definition Lists.xhtml │ ├── Emphasis.text │ ├── Emphasis.xhtml │ ├── Fenced Code Blocks.text │ ├── Fenced Code Blocks.xhtml │ ├── Footnotes.text │ ├── Footnotes.xhtml │ ├── Inline HTML with Markdown content.text │ ├── Inline HTML with Markdown content.xhtml │ ├── Tables.text │ └── Tables.xhtml └── PHP Markdown.mdtest │ ├── Auto Links.text │ ├── Auto Links.xhtml │ ├── Backslash escapes.text │ ├── Backslash escapes.xhtml │ ├── Code Spans.text │ ├── Code Spans.xhtml │ ├── Code block in a list item.text │ ├── Code block in a list item.xhtml │ ├── Code block on second line.text │ ├── Code block on second line.xhtml │ ├── Email auto links.text │ ├── Email auto links.xhtml │ ├── Emphasis.text │ ├── Emphasis.xhtml │ ├── Empty List Item.text │ ├── Empty List Item.xhtml │ ├── Headers.text │ ├── Headers.xhtml │ ├── Horizontal Rules.text │ ├── Horizontal Rules.xhtml │ ├── Inline HTML (Simple).html │ ├── Inline HTML (Simple).text │ ├── Inline HTML (Span).text │ ├── Inline HTML (Span).xhtml │ ├── Inline HTML comments.html │ ├── Inline HTML comments.text │ ├── Ins & del.text │ ├── Ins & del.xhtml │ ├── Links, inline style.text │ ├── Links, inline style.xhtml │ ├── MD5 Hashes.text │ ├── MD5 Hashes.xhtml │ ├── Mixed OLs and ULs.text │ ├── Mixed OLs and ULs.xhtml │ ├── Nesting.text │ ├── Nesting.xhtml │ ├── PHP-Specific Bugs.text │ ├── PHP-Specific Bugs.xhtml │ ├── Parens in URL.text │ ├── Parens in URL.xhtml │ ├── Quotes in attributes.text │ ├── Quotes in attributes.xhtml │ ├── Tight blocks.text │ └── Tight blocks.xhtml └── spec ├── basics ├── code-block.md ├── code-block.xhtml ├── code-inline.md ├── code-inline.xhtml ├── emphasis.md ├── emphasis.xhtml ├── headers.md ├── headers.xhtml ├── images-inline.md ├── images-inline.xhtml ├── images-references.md ├── images-references.xtml ├── inline-links-title.md ├── inline-links-title.xhtml ├── inline-links.md ├── inline-links.xhtml ├── lists-1.md ├── lists-1.xhtml ├── lists-2.md ├── lists-2.xhtml ├── lists-3.md ├── lists-3.xhtml ├── lists-with-blanks.md ├── lists-with-blanks.xhtml ├── ordered.md ├── ordered.xhtml ├── references-with-names.md ├── references-with-names.xhtml ├── references.md └── references.xhtml └── syntax ├── auto-escaping.md ├── auto-escaping.xhtml ├── autolinks.md ├── autolinks.xhtml ├── blockquotes.md ├── code-inline.md ├── code-inline.xhtml ├── code.md ├── code.xhtml ├── complex-lists.md ├── emphasis.md ├── emphasis.xhtml ├── headers.md ├── hrules.md ├── hrules.xhtml ├── images.md ├── inline-html.md ├── links.md ├── links.xhtml ├── lists-1.md └── lists-1.xhtml /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | lib/ 3 | .DS_STORE 4 | .log 5 | *.sublime-* 6 | -------------------------------------------------------------------------------- /Jakefile: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var util = require('util'); 3 | var PEG = require('pegjs'); 4 | 5 | // CONSTANTS 6 | 7 | var SRC_DIR = "."; 8 | var TEST_DIR = "./test"; 9 | var LIB_DIR = "./lib"; 10 | 11 | var PEGJS_REQ = 'pegjs'; 12 | var PARSER_DEFS_FILE = SRC_DIR + '/parser-defs.js'; 13 | var PARSER_SRC_FILE = SRC_DIR + '/markdown.pegjs'; 14 | var PARSER_OUT_FILE = LIB_DIR + '/markdown.parser.js'; 15 | 16 | /*var TESTS = { 17 | 'man': { 'dir': 'manual', 18 | 'in-ext': 'md', 19 | 'check-ext': 'xhtml' }, 20 | 'md-base': { 'dir': 'mdtest1.1/Markdown.mdtest', 21 | 'in-ext': 'text', 22 | 'check-ext': 'x?html' }, 23 | 'md-php': { 'dir': 'mdtest1.1/PHP Markdown.mdtest', 24 | 'in-ext': 'text', 25 | 'check-ext': 'x?html' }, 26 | 'md-php-ex': { 'dir': 'mdtest1.1/PHP Markdown Extra.mdtest', 27 | 'in-ext': 'text', 28 | 'check-ext': 'x?html' }, 29 | 'spec-bsc': { 'dir': 'spec/basics', 30 | 'in-ext': 'md', 31 | 'check-ext': 'xhtml' }, 32 | 'spec-stx': { 'dir': 'spec/syntax', 33 | 'in-ext': 'md', 34 | 'check-ext': 'xhtml' } 35 | }*/ 36 | 37 | // ======== UTILS 38 | 39 | function abort(message) { 40 | util.error(message); 41 | exitFailure(); 42 | } 43 | 44 | function removeDir(dir) { 45 | fs.readdirSync(dir).every(function(file) { 46 | var file = dir + "/" + file; 47 | 48 | var stats = fs.statSync(file); 49 | if (stats.isDirectory()) { 50 | removeDir(file); 51 | } else { 52 | fs.unlinkSync(file); 53 | } 54 | 55 | return true; 56 | }); 57 | 58 | fs.rmdirSync(dir); 59 | } 60 | 61 | function dirExists(dir) { 62 | try { 63 | var stats = fs.statSync(file); 64 | } catch (e) { 65 | return false; 66 | } 67 | 68 | return stats.isDirectory(); 69 | } 70 | 71 | function mkdirUnlessExists(dir) { 72 | try { 73 | fs.statSync(dir); 74 | } catch (e) { 75 | fs.mkdirSync(dir, 0755); 76 | } 77 | } 78 | 79 | // ======== TASKS 80 | 81 | desc('Remove previously built versions'); 82 | task('clean', [], function() { 83 | console.log('[Cleaning]: ' + LIB_DIR); 84 | 85 | if (dirExists(LIB_DIR)) { 86 | removeDir(LIB_DIR); 87 | } 88 | }); 89 | 90 | desc('Generate the Markdown parser'); 91 | task('build', [], function() { 92 | 93 | console.log('[Building]: ' + PARSER_SRC_FILE + ' -> ...'); 94 | 95 | var input = fs.readFileSync(PARSER_SRC_FILE, 'utf8'); 96 | 97 | try { 98 | var parser = PEG.buildParser(input); 99 | } catch (e) { 100 | if (e.line !== undefined && e.column !== undefined) { 101 | abort(e.line + ":" + e.column + ": " + e.message); 102 | } else { 103 | abort(e.message); 104 | } 105 | } 106 | 107 | mkdirUnlessExists(LIB_DIR); 108 | fs.writeFileSync(PARSER_OUT_FILE, "PEG.parser = " + parser.toSource() + ";\n"); 109 | 110 | console.log('[Built]: -> ' + PARSER_OUT_FILE); 111 | 112 | }); 113 | 114 | desc('Test'); 115 | task('test', [], function() { 116 | console.log(util.inspect(Array.prototype.slice.call(arguments))); 117 | }); 118 | 119 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Markdown parser with PegJS 2 | ========================== 3 | 4 | A Markdown parser written in JavaScript, generated with PEG grammar. Currently, in progress. 5 | 6 | This is a component of [xtd][xtd-md] project, but I plan to finish developing it separately and then merge the result there. (So, the most part of its development history is located there). 7 | 8 | In fact, it is a translation of [PegC Markdown parser][] to JavaScript. But in the end, there are a lot differences in the sources and result. 9 | 10 | The both C variant and JS (this) variant build a tree of parsed document elements, including their offsets and additional data required for generating some HTML result or hightlighting a syntax in some JavaScript implementation. 11 | 12 | Sources 13 | ------- 14 | 15 | * [Markdown][] by [John Gruber][], a great documents' syntax agreement 16 | * [PegJS][] by [David Majda][], a JavaScript parsers generator using PEG-like grammars 17 | * [My Customized PegJS Implementation][] with `chunk` variables inside actions and merged with [PegJS predicate fix][]. 18 | * [PegC GUI-oriented Markdown parser][] by [Ali Rantakari][], the place where I've found a parser and copied it and now I am modifying it for JavaScript 19 | * [PegC Markdown parser][] by [John MacFarlane][], the version the previous author adapted to implement his GUI-oriented version and in fact the actual and the main PegC parser (and I am taking parts from there to include new things here) 20 | * [PegC][] by [Stephan Beal][], itself 21 | * [PegHS Markdown parser][], again by [John MacFarlane][], if you are interested 22 | * [Codemirror 2][], the nerdy JS-written any-language source-code editor I plan to integrate with 23 | * [MDTest 1.1][] by [Michel Fortin][] 24 | 25 | The Development State 26 | --------------------- 27 | 28 | Finished 29 | 30 | * Inlines: Strong, Em, Code 31 | * Html Blocks, Html entities 32 | * Headings 33 | * Horizontal Rules 34 | * Paragraphs 35 | * Top-level Lists 36 | * Top-level verbatims 37 | * Links, all modifications 38 | * Images, all modifications 39 | * Oh, all that stuff except complex lists 40 | 41 | Not finished 42 | 43 | (They were working some not ideal way, but I am currently refactoring this part) 44 | 45 | * Nested lists and blocks inside them 46 | * Different extra syntax 47 | * Search over the new stuff in [PegC Markdown parser][] implementation 48 | * Test over for for [Markdown Syntax][] 49 | * Check out [Markdown Gotchas][] 50 | * Test with [MDTest 1.1][] by [Michel Fortin][] 51 | * Support [Markdown Extra][] 52 | 53 | So currently, the *lists* are parsed ok, but I plan to modify their rules to support complex indentations. 54 | 55 | Which Way the Result Looks Like 56 | ------------------------------- 57 | 58 | When parsing a MarkDown document, you get a JavaScript Object containing the document tree in Markdown terms. I'll make a detailed description when I'll finish an implementation. 59 | 60 | Competitors 61 | ----------- 62 | 63 | Just a JS-ones: 64 | 65 | * [Showdown][] by [Corey Innis][] 66 | * [MarkdownJS][] by [Dominic Baggott][] 67 | * [Pagedown][] used at [StackOverflow][] 68 | * [WMDEditor][] used at [StackOverflow][] 69 | 70 | To Develop 71 | ---------- 72 | 73 | Install last [node.js][] version (`v0.5.8+`) 74 | 75 | Install [npm][] 76 | 77 | Run in node directory (or with `-g`): 78 | 79 | npm install pegjs 80 | npm install jake@1.7 # or higher 81 | 82 | cd ~/Worktable # (for example) 83 | git clone git@github.com:shamansir/pegjs.git 84 | cd ./pegjs 85 | jake build 86 | node test/run 87 | ln -sf ~/Worktable/pegjs /lib/node_modules 88 | ln -s /lib/node_modules ./node_modules # optional, if pegjs module not found 89 | cd ~/Workspace # (for example) 90 | git clone git@github.com:shamansir/mdown-parse-pegjs.git 91 | cd ./mdown-parse-pegjs 92 | node ./test-mdown-parser-with-node.js 93 | 94 | [xtd-md]: https://github.com/shamansir/xtd/tree/master/sources/assets/mdown-parse-pegjs 95 | 96 | [Markdown]: http://daringfireball.net/projects/markdown/syntax 97 | [Markdown Syntax]: http://daringfireball.net/projects/markdown/syntax 98 | [Markdown Extra]: http://michelf.com/projects/php-markdown/extra/ 99 | [Codemirror 2]: http://codemirror.net/ 100 | 101 | [PegC]: http://fossil.wanderinghorse.net/repos/pegc/index.cgi/index 102 | [PegJS]: http://pegjs.majda.cz 103 | [My Customized PegJS Implementation]: https://github.com/shamansir/pegjs 104 | [PegJS predicate fix]: https://github.com/jdarpinian/pegjs 105 | 106 | [PegC Markdown Parser]: https://github.com/jgm/peg-markdown 107 | [PegC GUI-oriented Markdown parser]: http://hasseg.org/peg-markdown-highlight/ 108 | [PegHS Markdown Parser]: https://github.com/jgm/markdown-peg 109 | 110 | [John Gruber]: http://daringfireball.net/ 111 | [John MacFarlane]: http://johnmacfarlane.net/ 112 | [David Majda]: http://majda.cz/en/ 113 | [Ali Rantakari]: http://hasseg.org 114 | [Dominic Baggott]: http://www.evilstreak.co.uk/ 115 | [Corey Innis]: http://coolerator.net/ 116 | [Michel Fortin]: http://michelf.com/ 117 | [Stephan Beal]: http://wanderinghorse.net/home/stephan 118 | 119 | [Showdown]: https://github.com/coreyti/showdown 120 | [MarkdownJS]: https://github.com/evilstreak/markdown-js/blob/master/lib/markdown.js 121 | [Pagedown]: http://code.google.com/p/pagedown/ 122 | [WMDEditor]: http://code.google.com/p/wmd/ 123 | [StackOverflow]: http://stackoverflow.com/ 124 | 125 | [node.js]: http://nodejs.org/#download 126 | [npm]: http://npmjs.org/ 127 | [MDTest 1.0]: http://six.pairlist.net/pipermail/markdown-discuss/2007-July/000674.html 128 | [MDTest 1.1]: http://git.michelf.com/mdtest/ 129 | -------------------------------------------------------------------------------- /helpers/markdown.peghs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fglasgow-exts #-} 2 | 3 | {- Markdown.hs - Haskell implementation of markdown using PEG grammar. 4 | (c) 2008 John MacFarlane 5 | Released under the GPL 6 | -} 7 | 8 | import Text.Parsers.Frisby 9 | import Text.Parsers.Frisby.Char 10 | import Text.Pandoc.XML 11 | import Data.Char (toUpper) 12 | import Text.PrettyPrint.HughesPJ hiding (text, char, (<>), empty) 13 | import qualified Text.PrettyPrint.HughesPJ as P (text, char, (<>), empty) 14 | import System.Environment 15 | 16 | -- Uncomment the following two lines for UTF8 support (requires utf8-string library): 17 | -- import System.IO.UTF8 18 | -- import Prelude hiding (getContents, putStrLn, readFile) 19 | 20 | main :: IO () 21 | main = do 22 | argv <- getArgs 23 | c <- if null argv 24 | then getContents 25 | else mapM readFile argv >>= return . unlines 26 | let (blocks, remaining) = runPeg doc $ tabFilter tabStop (c ++ "\n") 27 | if (not . null) remaining 28 | then error $ "Parse failed at: " ++ take 35 remaining 29 | else do 30 | -- extract link references first, then convert to HTML 31 | let refs = map (\(Reference l (Src (s,t))) -> (l, (s,t))) $ filter isReference blocks 32 | putStrLn $ render $ vcat $ map (blockToHtml refs) blocks 33 | 34 | -- | A link target: a URL and title, or a reference, or nothing. 35 | data Target = Src (String, String) -- ^ (URL, title) 36 | | Ref [Inline] String -- ^ the string contains spaces before the reference: e.g. " " in "[label] [ref]" 37 | | Null -- ^ this is used for shortcut references: "[label]" 38 | deriving (Show, Read, Eq) 39 | 40 | -- | An inline (span-level) element. 41 | data Inline = 42 | Text String 43 | | Entity String -- ^ an entity reference without the '&' and ';' 44 | | Space 45 | | LineBreak 46 | | Emph [Inline] 47 | | Strong [Inline] 48 | | Code String 49 | | Link [Inline] Target 50 | | Image [Inline] Target 51 | | Html String -- ^ raw HTML 52 | deriving (Show, Read, Eq) 53 | 54 | -- | A block element. 55 | data Block = 56 | Para [Inline] 57 | | Plain [Inline] 58 | | Heading Int [Inline] 59 | | BlockQuote [Block] 60 | | BulletList [[Block]] 61 | | OrderedList [[Block]] 62 | | HtmlBlock String 63 | | Verbatim String 64 | | HorizontalRule 65 | | Reference [Inline] Target -- ^ a link reference: e.g. [label]: /url "title" 66 | | Markdown String -- ^ unprocessed markdown, to be parsed into blocks 67 | deriving (Show, Read, Eq) 68 | 69 | {- Reading the grammar: 70 | 71 | Standard PEG Frisby 72 | ------------ ----------------------- 73 | A* many A 74 | A+ many1 A 75 | A? optional A (returns () if no match) 76 | option B A (same thing but returns B if no match) 77 | !A doesNotMatch A 78 | &A peek A 79 | A / B A // B 80 | [abc] oneOf "abc" 81 | [^abc] noneOf "abc" 82 | 'a' char 'a' 83 | "abc" text "abc" 84 | A B A <> B -- parses A, then B, and returns a pair (A, B) 85 | A ->> B -- parses A, then B, and returns A 86 | A <<- B -- parses A, then B, and returns B 87 | A <++> B -- parses A, then B, and returns concatenation of A and B 88 | eof eof 89 | A <- B A <- newRule $ B 90 | 91 | Other Frisby peculiarities: 92 | 93 | X ## f -- parses X and passes the result through function f 94 | X ##> a -- parses X and returns constant a 95 | 96 | -} 97 | 98 | -- | The PEG grammar definition for Markdown. 99 | doc :: forall s . PM s (P s ([Block], String)) 100 | doc = mdo 101 | 102 | -- characters and tokens 103 | spaceChar <- newRule $ oneOf " \t" 104 | newline <- newRule $ text "\n" 105 | sp <- newRule $ many spaceChar 106 | spnl <- newRule $ sp <++> option "" (newline <++> sp) 107 | specialChar <- newRule $ oneOf "*_`&[]> doesNotMatch newline ->> anyChar) 109 | escapedChar <- newRule $ char '\\' ->> anyChar 110 | 111 | -- strings 112 | nonindentSpace <- newRule $ option "" (text " " // text " " // text " ") 113 | indent <- newRule $ text "\t" // text " " 114 | indentedLine <- newRule $ indent ->> anyline 115 | optionallyIndentedLine <- newRule $ indent ->> anyline 116 | anyline <- newRule $ many (doesNotMatch newline ->> doesNotMatch eof ->> anyChar) <++> option "" newline 117 | blankline <- newRule $ sp <++> newline 118 | blockquoteLine <- newRule $ nonindentSpace ->> char '>' ->> optional (char ' ') ->> anyline 119 | quoted <- newRule $ (text "\"" <++> many (noneOf "\"") <++> text "\"") // 120 | (text "'" <++> many (noneOf "'") <++> text "'") 121 | htmlAttribute <- newRule $ many1 alphaNum <++> spnl <++> option "" (text "=" <++> spnl <++> 122 | (quoted // many1 (doesNotMatch spaces ->> anyChar))) <++> spnl 123 | htmlComment <- newRule $ text "") ->> anyChar) <++> text "-->" 124 | htmlTag <- newRule $ text "<" <++> spnl <++> option "" (text "/") <++> many1 alphaNum <++> 125 | spnl <++> (many htmlAttribute ## concat) <++> option "" (text "/") <++> text ">" 126 | 127 | -- inlines 128 | inline <- newRule $ strong // emph // code // endline // spaces // link // image // autolink // 129 | rawHtml // str // entity // special 130 | 131 | emph <- newRule $ emphStar // emphUl 132 | oneStar <- newRule $ char '*' <<- doesNotMatch oneStar 133 | emphStar <- newRule $ oneStar ->> doesNotMatch spaceChar ->> doesNotMatch newline ->> 134 | many1 (strong // (doesNotMatch (spnl ->> oneStar) ->> inline)) <<- oneStar ## Emph 135 | oneUl <- newRule $ char '_' <<- doesNotMatch oneUl 136 | emphUl <- newRule $ oneUl ->> doesNotMatch spaceChar ->> doesNotMatch newline ->> 137 | many1 (strong // (doesNotMatch (spnl ->> oneUl) ->> inline)) <<- oneUl <<- 138 | doesNotMatch alphaNum ## Emph 139 | 140 | strong <- newRule $ strongStar // strongUl 141 | twoStar <- newRule $ text "**" <<- doesNotMatch twoStar 142 | twoUl <- newRule $ text "__" <<- doesNotMatch twoStar 143 | strongStar <- newRule $ twoStar ->> doesNotMatch spaceChar ->> doesNotMatch newline ->> 144 | many1 (doesNotMatch (spnl ->> twoStar) ->> inline) <<- twoStar ## Strong 145 | strongUl <- newRule $ twoUl ->> doesNotMatch spaceChar ->> doesNotMatch newline ->> 146 | many1 (doesNotMatch (spnl ->> twoUl) ->> inline) <<- twoUl <<- 147 | doesNotMatch alphaNum ## Strong 148 | 149 | let ticks n = text (replicate n '`') <<- doesNotMatch (char '`') 150 | let betweenTicks n = ticks n ->> many1 (many1 (noneOf "`") // doesNotMatch (ticks n) ->> many1 (char '`')) <<- 151 | ticks n ## lrstrip ' ' . concat 152 | code <- newRule $ peek (char '`') ->> choice (map betweenTicks $ reverse [1..10]) ## Code 153 | 154 | rawHtml <- newRule $ (htmlComment // htmlTag) ## Html 155 | 156 | str <- newRule $ many1 normalChar ## Text 157 | special <- newRule $ specialChar ## Text . (: []) 158 | spaces <- newRule $ many1 spaceChar ##> Space 159 | endline <- newRule $ optional (text " ") <> newline <> doesNotMatch blankline <> doesNotMatch eof ##> Space 160 | linebreak <- newRule $ text " " ->> sp ->> endline ##> LineBreak 161 | entity <- newRule $ char '&' ->> (text "#" <++> (text "x" // text "X") <++> many1 hexDigit // 162 | text "#" <++> many1 digit // many1 alphaNum) <<- char ';' ## Entity 163 | 164 | label <- newRule $ char '[' ->> many (doesNotMatch (char ']') ->> inline) <<- char ']' 165 | title <- newRule $ char '"' ->> many (doesNotMatch (char '"' <> sp <> (text ")" // newline)) ->> 166 | doesNotMatch newline ->> anyChar) <<- char '"' // 167 | char '\'' ->> many (doesNotMatch (char '\'' <> sp <> (text ")" // newline)) ->> 168 | doesNotMatch newline ->> anyChar) <<- char '\'' 169 | source <- newRule $ char '<' ->> source' <<- char '>' // source' 170 | source' <- newRule $ many (many1 (noneOf "()> \n\t") // (text "(" <++> source' <++> text ")") // 171 | (text "<" <++> source' <++> text ">")) ## concat 172 | sourceAndTitle <- newRule $ char '(' ->> sp ->> source <<- spnl <> option "" title <<- sp <<- char ')' 173 | explicitLink <- newRule $ label <> spnl ->> sourceAndTitle ## (\(l, s) -> Link l (Src s)) 174 | autolinkUrl <- newRule $ char '<' ->> many1 alpha <++> text "://" <++> 175 | many1 (doesNotMatch newline ->> doesNotMatch (char '>') ->> anyChar) <<- char '>' ## 176 | (\s -> Link [Text s] (Src (s, ""))) 177 | autolinkEmail <- newRule $ char '<' ->> many1 alpha <++> text "@" <++> 178 | many1 (doesNotMatch newline ->> doesNotMatch (char '>') ->> anyChar) <<- char '>' ## 179 | (\s -> Link [Text s] (Src ("mailto:" ++ s, ""))) 180 | autolink <- newRule $ autolinkUrl // autolinkEmail 181 | referenceLink <- newRule $ label <> spnl <> label ## (\((l1,s), l2) -> Link l1 (Ref l2 s)) // 182 | label ## (\l -> Link l Null) 183 | 184 | link <- newRule $ explicitLink // referenceLink 185 | image <- newRule $ char '!' ->> link ## (\(Link x y) -> Image x y) 186 | 187 | -- blocks 188 | block <- newRule $ blockquote // verbatim // reference // htmlBlock // heading // list // horizontalRule // 189 | para // plain 190 | para <- newRule $ many1 inline <<- newline <<- many1 blankline ## Para 191 | plain <- newRule $ many1 inline <<- optional blankline ## Plain 192 | blockquote <- newRule $ many1 (many1 blockquoteLine <++> many (doesNotMatch blankline ->> anyline) <++> 193 | many blankline ## concat) ## (\ls -> BlockQuote [Markdown $ concat ls ++ "\n"]) 194 | 195 | let setextHeadingWith lev c = many1 (doesNotMatch endline ->> inline) <<- newline <<- 196 | text (replicate 3 c) <<- (many (char c)) <<- newline ## Heading lev 197 | setextHeading <- newRule $ setextHeadingWith 1 '=' // setextHeadingWith 2 '-' 198 | 199 | let atxHeadingFor lev = text (replicate lev '#') ->> 200 | many1 (doesNotMatch endline ->> doesNotMatch (char '#') ->> inline) <<- 201 | many (oneOf "# \t") <<- newline ## Heading lev 202 | atxHeading <- newRule $ choice $ map atxHeadingFor [6, 5..1] 203 | 204 | heading <- newRule $ (atxHeading // setextHeading) <<- many blankline 205 | 206 | let horizontalRuleWith c = nonindentSpace ->> char c ->> sp ->> char c ->> sp ->> char c ->> 207 | many (sp ->> char c) ->> sp ->> newline ->> many1 blankline ##> HorizontalRule 208 | horizontalRule <- newRule $ choice $ map horizontalRuleWith ['*', '_', '-'] 209 | 210 | verbatim <- newRule $ many1 (doesNotMatch blankline ->> indentedLine) <++> 211 | (many (many1 (optional indent ->> blankline) <++> 212 | many1 (doesNotMatch blankline ->> indentedLine)) ## concat) <<- 213 | many blankline ## Verbatim . concat 214 | 215 | list <- newRule $ bulletList // orderedList 216 | 217 | bullet <- newRule $ nonindentSpace ->> oneOf "+*-" <<- many1 spaceChar ## (: []) 218 | bulletList <- newRule $ bulletListTight // bulletListLoose 219 | bulletListTight <- newRule $ many1 (bulletListItem ## (\s -> [Markdown s])) <<- many blankline <<- 220 | doesNotMatch bulletListLoose ## BulletList 221 | bulletListLoose <- newRule $ many1 ((bulletListItem <<- many blankline) ## (\s -> [Markdown $ s ++ "\n\n"])) ## 222 | BulletList 223 | bulletListItem <- newRule $ doesNotMatch horizontalRule ->> bullet ->> 224 | listBlock <++> (many listContinuationBlock ## concat) 225 | listBlock <- newRule $ anyline <++> (many (doesNotMatch (optional indent ->> (bulletListItem // orderedListItem)) 226 | ->> doesNotMatch blankline ->> doesNotMatch (indent ->> (bullet // enumerator)) ->> 227 | optionallyIndentedLine) ## concat) 228 | listContinuationBlock <- newRule $ ((many1 blankline ## concat) // unit "\0") <++> 229 | (many1 (indent ->> listBlock) ## concat) 230 | 231 | enumerator <- newRule $ nonindentSpace ->> many1 digit <<- char '.' <<- many1 spaceChar 232 | orderedList <- newRule $ orderedListTight // orderedListLoose 233 | orderedListTight <- newRule $ many1 (orderedListItem ## (\s -> [Markdown s])) <<- many blankline <<- 234 | doesNotMatch orderedListLoose ## OrderedList 235 | orderedListLoose <- newRule $ many1 ((orderedListItem <<- many blankline) ## (\s -> [Markdown $ s ++ "\n\n"])) ## 236 | OrderedList 237 | orderedListItem <- newRule $ enumerator ->> listBlock <++> (many listContinuationBlock ## concat) 238 | 239 | 240 | let htmlBlockOpening tag = text "<" <++> spnl <++> text tag <++> spnl <++> (many htmlAttribute ## concat) 241 | let htmlBlockSolo tag = htmlBlockOpening tag <++> text "/" <++> spnl <++> text ">" 242 | let htmlBlockWithEnd tag = htmlBlockOpening tag <++> text ">" <++> 243 | (many (doesNotMatch (htmlBlockEndFor tag) ->> 244 | (htmlBlockAny // many1 (noneOf "<") // text "<")) ## concat) <++> 245 | htmlBlockEndFor tag 246 | let htmlBlockEndFor tag = text "<" <++> spnl <++> text "/" <++> text tag <++> spnl <++> text ">" 247 | let htmlBlockFor tag = htmlBlockSolo tag // htmlBlockWithEnd tag 248 | let blockTags = ["address", "blockquote", "center", "dir", "div", "dl", "fieldset", "form", "h1", "h2", "h3", 249 | "h4", "h5", "h6", "hr", "isindex", "menu", "noframes", "noscript", "ol", "p", "pre", "table", 250 | "ul", "dd", "dt", "frameset", "li", "tbody", "td", "tfoot", "th", "thead", "tr", "script"] 251 | 252 | htmlBlockAny <- newRule $ choice $ map htmlBlockFor (blockTags ++ map (map toUpper) blockTags) 253 | htmlBlock <- newRule $ nonindentSpace <++> (htmlComment // htmlBlockAny) ## HtmlBlock 254 | 255 | -- references 256 | reference <- newRule $ nonindentSpace ->> label <> char ':' ->> spnl ->> 257 | many1 (doesNotMatch spaceChar ->> doesNotMatch newline ->> anyChar) <> 258 | spnl ->> option "" title <<- many blankline ## (\((l,s),t) -> Reference l (Src (s,t))) 259 | 260 | -- document - returns (block list, unparsed text) 261 | document <- newRule $ (many (many blankline ->> block) <<- many blankline) <> rest <<- eof 262 | return document 263 | 264 | -- 265 | -- Convert inlines and blocks to HTML 266 | -- 267 | 268 | -- | Convert inline element to HTML. 269 | inlineToHtml :: [([Inline],(String, String))] -- ^ list of link references 270 | -> Inline -- ^ inline element 271 | -> Doc 272 | inlineToHtml refs i = 273 | case i of 274 | Text s -> P.text (escapeStringForXML s) 275 | Entity s -> P.char '&' P.<> P.text s P.<> P.char ';' 276 | Space -> P.char ' ' 277 | LineBreak -> selfClosingTag "br" [] 278 | Code s -> inTagsSimple "code" $ P.text $ escapeStringForXML s 279 | Emph xs -> inTagsSimple "em" $ hcat $ map (inlineToHtml refs) xs 280 | Strong xs -> inTagsSimple "strong" $ hcat $ map (inlineToHtml refs) xs 281 | Html s -> P.text s 282 | -- an autolink or [explicit link](google.com) with no title 283 | Link l (Src (u,"")) -> inTags False "a" [("href", u)] $ hcat $ map (inlineToHtml refs) l 284 | -- an explicit link with a title: [like this](google.com "title") 285 | Link l (Src (u,t)) -> inTags False "a" [("href", u), ("title", t)] $ hcat $ map (inlineToHtml refs) l 286 | -- a shortcut-style reference link: [like this] 287 | Link l Null -> case lookup l refs of 288 | Just (u, "") -> inTags False "a" [("href", u)] $ hcat $ map (inlineToHtml refs) l 289 | Just (u, t) -> inTags False "a" [("href", u), ("title", t)] $ hcat $ 290 | map (inlineToHtml refs) l 291 | Nothing -> hcat $ map (inlineToHtml refs) $ [Text "["] ++ l ++ [Text "]"] 292 | -- a regular reference link: [like][this] or [like] [this] 293 | Link l (Ref r s) -> let r' = if null r then l else r 294 | in case lookup r' refs of 295 | Just (u, "") -> inTags False "a" [("href", u)] $ hcat $ map (inlineToHtml refs) l 296 | Just (u, t) -> inTags False "a" [("href", u), ("title", t)] $ hcat $ 297 | map (inlineToHtml refs) l 298 | Nothing -> hcat $ map (inlineToHtml refs) $ [Text "["] ++ l ++ 299 | [Text $ "]" ++ s ++ "["] ++ r ++ [Text "]"] 300 | Image l (Src (u,t)) -> selfClosingTag "img" [("src", u), ("title", t), 301 | ("alt", render $ hcat $ map (inlineToHtml refs) l)] 302 | -- a shortcut-style reference link: ![like this] 303 | Image l Null -> case lookup l refs of 304 | Just (u, t) -> inlineToHtml refs $ Image l (Src (u,t)) 305 | Nothing -> hcat $ map (inlineToHtml refs) $ [Text "!["] ++ l ++ [Text "]"] 306 | -- a regular reference link: ![like][this] or ![like] [this] 307 | Image l (Ref r s) -> let r' = if null r then l else r 308 | in case lookup r' refs of 309 | Just (u, t) -> inlineToHtml refs $ Image l (Src (u, t)) 310 | Nothing -> hcat $ map (inlineToHtml refs) $ [Text "!["] ++ l ++ 311 | [Text $ "]" ++ s ++ "["] ++ r ++ [Text "]"] 312 | 313 | -- | Convert block element to HTML. 314 | blockToHtml :: [([Inline],(String, String))] -- ^ list of link references 315 | -> Block -- ^ block element to convert 316 | -> Doc 317 | blockToHtml refs block = 318 | case block of 319 | Para xs -> inTagsSimple "p" $ wrap refs $ lrstrip Space xs 320 | Plain xs -> wrap refs $ lrstrip Space xs 321 | Heading lev xs -> inTagsSimple ("h" ++ show lev) $ hcat $ map (inlineToHtml refs) $ lrstrip Space xs 322 | HorizontalRule -> selfClosingTag "hr" [] 323 | BlockQuote xs -> inTagsIndented "blockquote" $ vcat $ map (blockToHtml refs) xs 324 | Verbatim s -> inTagsSimple "pre" $ inTagsSimple "code" $ P.text $ escapeStringForXML s 325 | BulletList items -> inTagsIndented "ul" $ vcat $ 326 | map (\item -> inTagsSimple "li" $ vcat $ map (blockToHtml refs) item) items 327 | OrderedList items -> inTagsIndented "ol" $ vcat $ 328 | map (\item -> inTagsSimple "li" $ vcat $ map (blockToHtml refs) item) items 329 | Markdown s -> -- handle a raw chunk of markdown, e.g. a list item or block quote contents 330 | -- if the chunk contains \0, it is split at that point into two chunks that 331 | -- are parsed separately. This allows correct handling of lists like: 332 | -- - item 333 | -- - sub 334 | -- - sub 335 | let (a, b) = break (=='\0') s 336 | (parsed, remaining) = runPeg doc a 337 | first = vcat $ map (blockToHtml refs) parsed 338 | in if null remaining 339 | then if null b 340 | then first 341 | else first $$ blockToHtml refs (Markdown $ tail b) 342 | else error $ "Parse failed at: " ++ take 35 remaining 343 | Reference _ _ -> P.empty 344 | HtmlBlock s -> P.text s 345 | 346 | -- 347 | -- Wrapping code and other utilities from pandoc 348 | -- 349 | 350 | -- | Take list of inline elements and return wrapped doc. 351 | wrap :: [([Inline],(String, String))] -> [Inline] -> Doc 352 | wrap refs lst = fsep $ map (hcat . map (inlineToHtml refs)) (splitBy Space lst) 353 | 354 | -- | Split list by groups of one or more sep. 355 | splitBy :: (Eq a) => a -> [a] -> [[a]] 356 | splitBy _ [] = [] 357 | splitBy s lst = 358 | let (x, xs) = break (== s) lst 359 | xs' = dropWhile (== s) xs 360 | in x:(splitBy s xs') 361 | 362 | -- | Strip leading and trailing elements. 363 | lrstrip :: (Eq a) => a -> [a] -> [a] 364 | lrstrip x = reverse . dropWhile (== x) . reverse . dropWhile (== x) 365 | 366 | tabStop :: Int 367 | tabStop = 4 368 | 369 | tabFilter :: Int -> String -> String 370 | tabFilter _ [] = "" 371 | tabFilter _ ('\r':'\n':xs) = '\n' : tabFilter tabStop xs 372 | tabFilter _ ('\r':xs) = '\n' : tabFilter tabStop xs 373 | tabFilter _ ('\n':xs) = '\n' : tabFilter tabStop xs 374 | tabFilter spsToNextStop ('\t':xs) = replicate spsToNextStop ' ' ++ tabFilter tabStop xs 375 | tabFilter 1 (x:xs) = x:(tabFilter tabStop xs) 376 | tabFilter spsToNextStop (x:xs) = x:(tabFilter (spsToNextStop - 1) xs) 377 | 378 | isReference :: Block -> Bool 379 | isReference (Reference _ _) = True 380 | isReference _ = False 381 | -------------------------------------------------------------------------------- /test-mdown-parser-with-node.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var PEG = require('pegjs'); 3 | 4 | var pegPath = process.cwd() + '/'; 5 | 6 | try { 7 | var parser = PEG.buildParser( 8 | fs.readFileSync(pegPath + 'markdown.pegjs', 'utf-8')); 9 | var testContent = fs.readFileSync(pegPath + 'mdown-test/manual/single-list-test.md', 'utf-8'); 10 | //var testContent = fs.readFileSync(pegPath + 'mdown-test/progressing.md', 'utf-8'); 11 | 12 | //var parser = PEG.buildParser( 13 | // fs.readFileSync(pegPath + 'temp.pegjs', 'utf-8')); 14 | //var testContent = fs.readFileSync(pegPath + 'temp.md', 'utf-8'); 15 | 16 | $_parser = parser; // a global variable to use from inside parse process 17 | var result = parser.parse(testContent); 18 | console.log('====='); 19 | console.log('result:', 20 | result.info(1 + 2 + 4 21 | // V_SHOW_DATA(1) | V_NO_STRIP_DATA(2) | V_NO_PAD_TEXT(4) 22 | )); 23 | } catch(e) { 24 | console.log('error',e); 25 | throw e; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /test/manual/all-types-links.md: -------------------------------------------------------------------------------- 1 | [before]: https://before.com 2 | 3 | This is a [standard](http://link.com) link. This [is][7] by integer id. [This][this] is by alias. And [aliases] [aliases] can be separated with space. 4 | [And][] this is with auto-generated label. Oh, [and inline with title](http://inline-title.org "Inline-Title") [by][] the [way][]. 5 | And yep, [reference with title][15]. Ids can contain [several words][]. [No][]-label link, by the way. [Before][]-link. 6 | 7 | Aah, and ![images](file://some.src) links are the things I almost forgot. Also, a ![ref-link][] to an image. They can be a links, see: ![[a-link](ht:/src)](ht:/img.src "Image title") 8 | 9 | And what about links with no title [](ht:/test)? 10 | 11 | * [Link][] in a bullet 12 | 13 | [7]: http://is.com 14 | [this]: http://this.com 15 | [aliases]: /aliases 16 | [and]: http://and.com 17 | [15]: http://ref-title.org "Ref-Title" 18 | [by]: 'Ref-Title' 19 | [way]: http://ref-title.org (Ref-Title) 20 | [several words]: http://several-words.com 21 | "And a lot of text here" 22 | 23 | 24 | I get 10 times more traffic from [Google][] than from 25 | [Yahoo][] or [MSN][]. 26 | 27 | [google]: http://google.com/ "Google" 28 | [yahoo]: http://search.yahoo.com/ "Yahoo Search" 29 | [msn]: http://search.msn.com/ "MSN Search" 30 | 31 | 32 | I get 10 times more traffic from [Google] [1] than from 33 | [Yahoo] [2] or [MSN] [3]. 34 | 35 | [1]: http://google.com/ "Google" 36 | [2]: http://search.yahoo.com/ "Yahoo Search" 37 | [3]: http://search.msn.com/ "MSN Search" 38 | 39 | -------------------------------------------------------------------------------- /test/manual/big.md: -------------------------------------------------------------------------------- 1 | 2 | Hello! 3 | ======= 4 | 5 | Another header 6 | ------------- 7 | 8 | Lets see _if the emphasis 9 | 10 | carries over_ to __another__ paragraph. 11 | 12 | And ` maybe this ` should Hello not be 13 | 14 | > ### Header 15 | > 16 | > Header 17 | > -------- 18 | > 19 | 20 | - - - 21 | 22 | * List 0 23 | * List 24 | * Hello! 25 | 26 | Hello 27 | 28 | Item 2 29 | Hello 30 | 31 | Hibuli habuli!*Code here* 32 | 33 | * Item 3 34 | 35 | * Hello again 36 | 37 | Hassd *code* 38 | 39 | Code here 40 | 41 | 42 | 43 | 1. Stuff 44 | 45 | Hello 46 | 47 | Markdown FTW! 48 | 49 | 50 | 1986\. What a great season. A link here: that should be automatically detected. 51 | 52 | Stuff *here!*. This is pretty cool. 53 | 54 | * Hello 55 | * Booboo 56 | 57 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 58 | 59 | 1. Stuff 60 | 1. Hello 61 | 9. Again 62 | 3211233. Stuff 63 | 64 | This is [an example](http://example.com/ "Title") inline link. 65 | 66 | ![][googleimg] 67 | 68 | [googleimg]: http://www.google.com/images/nav_logo6.png 69 | "Google!" 70 | 71 | ``Hello **`strong text** here`` 72 | 73 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 74 | 75 | # 2nd Headline 76 | 77 | Yeah. 78 | 79 | [name]: http://google.com 80 | [foo1]: http://example.com/ "Optional Title Here" 81 | [foo3]: http://example.com/ 82 | "'Optional Title Here" 83 | 84 | 85 | Some code 86 | 87 | 88 | Third headline 89 | ------------------- 90 | Some stuff here... 91 | 92 | 93 | 94 | Hello! 95 | ======= 96 | 97 | Another header 98 | ------------- 99 | 100 | Lets see _if the emphasis 101 | 102 | carries over_ to __another__ paragraph. 103 | 104 | And ` maybe this ` should Hello not be 105 | 106 | > ### Header 107 | > 108 | > Header 109 | > -------- 110 | > 111 | 112 | - - - 113 | 114 | * List 0 115 | * List 116 | * Hello! 117 | 118 | Hello 119 | 120 | Item 2 121 | Hello 122 | 123 | Hibuli habuli!*Code here* 124 | 125 | * Item 3 126 | 127 | * Hello again 128 | 129 | Hassd *code* 130 | 131 | Code here 132 | 133 | 134 | 135 | 1. Stuff 136 | 137 | Hello 138 | 139 | Markdown FTW! 140 | 141 | 142 | 1986\. What a great season. A link here: that should be automatically detected. 143 | 144 | Stuff *here!*. This is pretty cool. 145 | 146 | * Hello 147 | * Booboo 148 | 149 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 150 | 151 | 1. Stuff 152 | 1. Hello 153 | 9. Again 154 | 3211233. Stuff 155 | 156 | This is [an example](http://example.com/ "Title") inline link. 157 | 158 | ![][googleimg] 159 | 160 | [googleimg]: http://www.google.com/images/nav_logo6.png 161 | "Google!" 162 | 163 | ``Hello **`strong text** here`` 164 | 165 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 166 | 167 | # 2nd Headline 168 | 169 | Yeah. 170 | 171 | [name]: http://google.com 172 | [foo1]: http://example.com/ "Optional Title Here" 173 | [foo3]: http://example.com/ 174 | "'Optional Title Here" 175 | 176 | 177 | Some code 178 | 179 | 180 | Third headline 181 | ------------------- 182 | Some stuff here... 183 | 184 | 185 | 186 | Hello! 187 | ======= 188 | 189 | Another header 190 | ------------- 191 | 192 | Lets see _if the emphasis 193 | 194 | carries over_ to __another__ paragraph. 195 | 196 | And ` maybe this ` should Hello not be 197 | 198 | > ### Header 199 | > 200 | > Header 201 | > -------- 202 | > 203 | 204 | - - - 205 | 206 | * List 0 207 | * List 208 | * Hello! 209 | 210 | Hello 211 | 212 | Item 2 213 | Hello 214 | 215 | Hibuli habuli!*Code here* 216 | 217 | * Item 3 218 | 219 | * Hello again 220 | 221 | Hassd *code* 222 | 223 | Code here 224 | 225 | 226 | 227 | 1. Stuff 228 | 229 | Hello 230 | 231 | Markdown FTW! 232 | 233 | 234 | 1986\. What a great season. A link here: that should be automatically detected. 235 | 236 | Stuff *here!*. This is pretty cool. 237 | 238 | * Hello 239 | * Booboo 240 | 241 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 242 | 243 | 1. Stuff 244 | 1. Hello 245 | 9. Again 246 | 3211233. Stuff 247 | 248 | This is [an example](http://example.com/ "Title") inline link. 249 | 250 | ![][googleimg] 251 | 252 | [googleimg]: http://www.google.com/images/nav_logo6.png 253 | "Google!" 254 | 255 | ``Hello **`strong text** here`` 256 | 257 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 258 | 259 | # 2nd Headline 260 | 261 | Yeah. 262 | 263 | [name]: http://google.com 264 | [foo1]: http://example.com/ "Optional Title Here" 265 | [foo3]: http://example.com/ 266 | "'Optional Title Here" 267 | 268 | 269 | Some code 270 | 271 | 272 | Third headline 273 | ------------------- 274 | Some stuff here... 275 | 276 | 277 | 278 | Hello! 279 | ======= 280 | 281 | Another header 282 | ------------- 283 | 284 | Lets see _if the emphasis 285 | 286 | carries over_ to __another__ paragraph. 287 | 288 | And ` maybe this ` should Hello not be 289 | 290 | > ### Header 291 | > 292 | > Header 293 | > -------- 294 | > 295 | 296 | - - - 297 | 298 | * List 0 299 | * List 300 | * Hello! 301 | 302 | Hello 303 | 304 | Item 2 305 | Hello 306 | 307 | Hibuli habuli!*Code here* 308 | 309 | * Item 3 310 | 311 | * Hello again 312 | 313 | Hassd *code* 314 | 315 | Code here 316 | 317 | 318 | 319 | 1. Stuff 320 | 321 | Hello 322 | 323 | Markdown FTW! 324 | 325 | 326 | 1986\. What a great season. A link here: that should be automatically detected. 327 | 328 | Stuff *here!*. This is pretty cool. 329 | 330 | * Hello 331 | * Booboo 332 | 333 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 334 | 335 | 1. Stuff 336 | 1. Hello 337 | 9. Again 338 | 3211233. Stuff 339 | 340 | This is [an example](http://example.com/ "Title") inline link. 341 | 342 | ![][googleimg] 343 | 344 | [googleimg]: http://www.google.com/images/nav_logo6.png 345 | "Google!" 346 | 347 | ``Hello **`strong text** here`` 348 | 349 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 350 | 351 | # 2nd Headline 352 | 353 | Yeah. 354 | 355 | [name]: http://google.com 356 | [foo1]: http://example.com/ "Optional Title Here" 357 | [foo3]: http://example.com/ 358 | "'Optional Title Here" 359 | 360 | 361 | Some code 362 | 363 | 364 | Third headline 365 | ------------------- 366 | Some stuff here... 367 | 368 | 369 | 370 | Hello! 371 | ======= 372 | 373 | Another header 374 | ------------- 375 | 376 | Lets see _if the emphasis 377 | 378 | carries over_ to __another__ paragraph. 379 | 380 | And ` maybe this ` should Hello not be 381 | 382 | > ### Header 383 | > 384 | > Header 385 | > -------- 386 | > 387 | 388 | - - - 389 | 390 | * List 0 391 | * List 392 | * Hello! 393 | 394 | Hello 395 | 396 | Item 2 397 | Hello 398 | 399 | Hibuli habuli!*Code here* 400 | 401 | * Item 3 402 | 403 | * Hello again 404 | 405 | Hassd *code* 406 | 407 | Code here 408 | 409 | 410 | 411 | 1. Stuff 412 | 413 | Hello 414 | 415 | Markdown FTW! 416 | 417 | 418 | 1986\. What a great season. A link here: that should be automatically detected. 419 | 420 | Stuff *here!*. This is pretty cool. 421 | 422 | * Hello 423 | * Booboo 424 | 425 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 426 | 427 | 1. Stuff 428 | 1. Hello 429 | 9. Again 430 | 3211233. Stuff 431 | 432 | This is [an example](http://example.com/ "Title") inline link. 433 | 434 | ![][googleimg] 435 | 436 | [googleimg]: http://www.google.com/images/nav_logo6.png 437 | "Google!" 438 | 439 | ``Hello **`strong text** here`` 440 | 441 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 442 | 443 | # 2nd Headline 444 | 445 | Yeah. 446 | 447 | [name]: http://google.com 448 | [foo1]: http://example.com/ "Optional Title Here" 449 | [foo3]: http://example.com/ 450 | "'Optional Title Here" 451 | 452 | 453 | Some code 454 | 455 | 456 | Third headline 457 | ------------------- 458 | Some stuff here... 459 | 460 | 461 | 462 | Hello! 463 | ======= 464 | 465 | Another header 466 | ------------- 467 | 468 | Lets see _if the emphasis 469 | 470 | carries over_ to __another__ paragraph. 471 | 472 | And ` maybe this ` should Hello not be 473 | 474 | > ### Header 475 | > 476 | > Header 477 | > -------- 478 | > 479 | 480 | - - - 481 | 482 | * List 0 483 | * List 484 | * Hello! 485 | 486 | Hello 487 | 488 | Item 2 489 | Hello 490 | 491 | Hibuli habuli!*Code here* 492 | 493 | * Item 3 494 | 495 | * Hello again 496 | 497 | Hassd *code* 498 | 499 | Code here 500 | 501 | 502 | 503 | 1. Stuff 504 | 505 | Hello 506 | 507 | Markdown FTW! 508 | 509 | 510 | 1986\. What a great season. A link here: that should be automatically detected. 511 | 512 | Stuff *here!*. This is pretty cool. 513 | 514 | * Hello 515 | * Booboo 516 | 517 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 518 | 519 | 1. Stuff 520 | 1. Hello 521 | 9. Again 522 | 3211233. Stuff 523 | 524 | This is [an example](http://example.com/ "Title") inline link. 525 | 526 | ![][googleimg] 527 | 528 | [googleimg]: http://www.google.com/images/nav_logo6.png 529 | "Google!" 530 | 531 | ``Hello **`strong text** here`` 532 | 533 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 534 | 535 | # 2nd Headline 536 | 537 | Yeah. 538 | 539 | [name]: http://google.com 540 | [foo1]: http://example.com/ "Optional Title Here" 541 | [foo3]: http://example.com/ 542 | "'Optional Title Here" 543 | 544 | 545 | Some code 546 | 547 | 548 | Third headline 549 | ------------------- 550 | Some stuff here... 551 | 552 | 553 | 554 | Hello! 555 | ======= 556 | 557 | Another header 558 | ------------- 559 | 560 | Lets see _if the emphasis 561 | 562 | carries over_ to __another__ paragraph. 563 | 564 | And ` maybe this ` should Hello not be 565 | 566 | > ### Header 567 | > 568 | > Header 569 | > -------- 570 | > 571 | 572 | - - - 573 | 574 | * List 0 575 | * List 576 | * Hello! 577 | 578 | Hello 579 | 580 | Item 2 581 | Hello 582 | 583 | Hibuli habuli!*Code here* 584 | 585 | * Item 3 586 | 587 | * Hello again 588 | 589 | Hassd *code* 590 | 591 | Code here 592 | 593 | 594 | 595 | 1. Stuff 596 | 597 | Hello 598 | 599 | Markdown FTW! 600 | 601 | 602 | 1986\. What a great season. A link here: that should be automatically detected. 603 | 604 | Stuff *here!*. This is pretty cool. 605 | 606 | * Hello 607 | * Booboo 608 | 609 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 610 | 611 | 1. Stuff 612 | 1. Hello 613 | 9. Again 614 | 3211233. Stuff 615 | 616 | This is [an example](http://example.com/ "Title") inline link. 617 | 618 | ![][googleimg] 619 | 620 | [googleimg]: http://www.google.com/images/nav_logo6.png 621 | "Google!" 622 | 623 | ``Hello **`strong text** here`` 624 | 625 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 626 | 627 | # 2nd Headline 628 | 629 | Yeah. 630 | 631 | [name]: http://google.com 632 | [foo1]: http://example.com/ "Optional Title Here" 633 | [foo3]: http://example.com/ 634 | "'Optional Title Here" 635 | 636 | 637 | Some code 638 | 639 | 640 | Third headline 641 | ------------------- 642 | Some stuff here... 643 | 644 | 645 | 646 | Hello! 647 | ======= 648 | 649 | Another header 650 | ------------- 651 | 652 | Lets see _if the emphasis 653 | 654 | carries over_ to __another__ paragraph. 655 | 656 | And ` maybe this ` should Hello not be 657 | 658 | > ### Header 659 | > 660 | > Header 661 | > -------- 662 | > 663 | 664 | - - - 665 | 666 | * List 0 667 | * List 668 | * Hello! 669 | 670 | Hello 671 | 672 | Item 2 673 | Hello 674 | 675 | Hibuli habuli!*Code here* 676 | 677 | * Item 3 678 | 679 | * Hello again 680 | 681 | Hassd *code* 682 | 683 | Code here 684 | 685 | 686 | 687 | 1. Stuff 688 | 689 | Hello 690 | 691 | Markdown FTW! 692 | 693 | 694 | 695 | 1986\. What a great season. A link here: that should be automatically detected. 696 | 697 | Stuff *here!*. This is pretty cool. 698 | 699 | * Hello 700 | * Booboo 701 | 702 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 703 | 704 | 1. Stuff 705 | 1. Hello 706 | 9. Again 707 | 3211233. Stuff 708 | 709 | This is [an example](http://example.com/ "Title") inline link. 710 | 711 | ![][googleimg] 712 | 713 | [googleimg]: http://www.google.com/images/nav_logo6.png 714 | "Google!" 715 | 716 | ``Hello **`strong text** here`` 717 | 718 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 719 | 720 | # 2nd Headline 721 | 722 | Yeah. 723 | 724 | [name]: http://google.com 725 | [foo1]: http://example.com/ "Optional Title Here" 726 | [foo3]: http://example.com/ 727 | "'Optional Title Here" 728 | 729 | 730 | Some code 731 | 732 | 733 | Third headline 734 | ------------------- 735 | Some stuff here... 736 | 737 | 738 | 739 | Hello! 740 | ======= 741 | 742 | Another header 743 | ------------- 744 | 745 | Lets see _if the emphasis 746 | 747 | carries over_ to __another__ paragraph. 748 | 749 | And ` maybe this ` should Hello not be 750 | 751 | > ### Header 752 | > 753 | > Header 754 | > -------- 755 | > 756 | 757 | - - - 758 | 759 | * List 0 760 | * List 761 | * Hello! 762 | 763 | Hello 764 | 765 | Item 2 766 | Hello 767 | 768 | Hibuli habuli!*Code here* 769 | 770 | * Item 3 771 | 772 | * Hello again 773 | 774 | Hassd *code* 775 | 776 | Code here 777 | 778 | 779 | 780 | 1. Stuff 781 | 782 | Hello 783 | 784 | Markdown FTW! 785 | 786 | 787 | 1986\. What a great season. A link here: that should be automatically detected. 788 | 789 | Stuff *here!*. This is pretty cool. 790 | 791 | * Hello 792 | * Booboo 793 | 794 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 795 | 796 | 1. Stuff 797 | 1. Hello 798 | 9. Again 799 | 3211233. Stuff 800 | 801 | This is [an example](http://example.com/ "Title") inline link. 802 | 803 | ![][googleimg] 804 | 805 | [googleimg]: http://www.google.com/images/nav_logo6.png 806 | "Google!" 807 | 808 | ``Hello **`strong text** here`` 809 | 810 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 811 | 812 | # 2nd Headline 813 | 814 | Yeah. 815 | 816 | [name]: http://google.com 817 | [foo1]: http://example.com/ "Optional Title Here" 818 | [foo3]: http://example.com/ 819 | "'Optional Title Here" 820 | 821 | 822 | Some code 823 | 824 | 825 | Third headline 826 | ------------------- 827 | Some stuff here... 828 | 829 | 830 | 831 | Hello! 832 | ======= 833 | 834 | Another header 835 | ------------- 836 | 837 | Lets see _if the emphasis 838 | 839 | carries over_ to __another__ paragraph. 840 | 841 | And ` maybe this ` should Hello not be 842 | 843 | > ### Header 844 | > 845 | > Header 846 | > -------- 847 | > 848 | 849 | - - - 850 | 851 | * List 0 852 | * List 853 | * Hello! 854 | 855 | Hello 856 | 857 | Item 2 858 | Hello 859 | 860 | Hibuli habuli!*Code here* 861 | 862 | * Item 3 863 | 864 | * Hello again 865 | 866 | Hassd *code* 867 | 868 | Code here 869 | 870 | 871 | 872 | 1. Stuff 873 | 874 | Hello 875 | 876 | Markdown FTW! 877 | 878 | 879 | 1986\. What a great season. A link here: that should be automatically detected. 880 | 881 | Stuff *here!*. This is pretty cool. 882 | 883 | * Hello 884 | * Booboo 885 | 886 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 887 | 888 | 1. Stuff 889 | 1. Hello 890 | 9. Again 891 | 3211233. Stuff 892 | 893 | This is [an example](http://example.com/ "Title") inline link. 894 | 895 | ![][googleimg] 896 | 897 | [googleimg]: http://www.google.com/images/nav_logo6.png 898 | "Google!" 899 | 900 | ``Hello **`strong text** here`` 901 | 902 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 903 | 904 | # 2nd Headline 905 | 906 | Yeah. 907 | 908 | [name]: http://google.com 909 | [foo1]: http://example.com/ "Optional Title Here" 910 | [foo3]: http://example.com/ 911 | "'Optional Title Here" 912 | 913 | 914 | Some code 915 | 916 | 917 | Third headline 918 | ------------------- 919 | Some stuff here... 920 | 921 | 922 | 923 | Hello! 924 | ======= 925 | 926 | Another header 927 | ------------- 928 | 929 | Lets see _if the emphasis 930 | 931 | carries over_ to __another__ paragraph. 932 | 933 | And ` maybe this ` should Hello not be 934 | 935 | > ### Header 936 | > 937 | > Header 938 | > -------- 939 | > 940 | 941 | - - - 942 | 943 | * List 0 944 | * List 945 | * Hello! 946 | 947 | Hello 948 | 949 | Item 2 950 | Hello 951 | 952 | Hibuli habuli!*Code here* 953 | 954 | * Item 3 955 | 956 | * Hello again 957 | 958 | Hassd *code* 959 | 960 | Code here 961 | 962 | 963 | 964 | 1. Stuff 965 | 966 | Hello 967 | 968 | Markdown FTW! 969 | 970 | 971 | 1986\. What a great season. A link here: that should be automatically detected. 972 | 973 | Stuff *here!*. This is pretty cool. 974 | 975 | * Hello 976 | * Booboo 977 | 978 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 979 | 980 | 1. Stuff 981 | 1. Hello 982 | 9. Again 983 | 3211233. Stuff 984 | 985 | This is [an example](http://example.com/ "Title") inline link. 986 | 987 | ![][googleimg] 988 | 989 | [googleimg]: http://www.google.com/images/nav_logo6.png 990 | "Google!" 991 | 992 | ``Hello **`strong text** here`` 993 | 994 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 995 | 996 | # 2nd Headline 997 | 998 | Yeah. 999 | 1000 | [name]: http://google.com 1001 | [foo1]: http://example.com/ "Optional Title Here" 1002 | [foo3]: http://example.com/ 1003 | "'Optional Title Here" 1004 | 1005 | 1006 | Some code 1007 | 1008 | 1009 | Third headline 1010 | ------------------- 1011 | Some stuff here... 1012 | 1013 | 1014 | 1015 | Hello! 1016 | ======= 1017 | 1018 | Another header 1019 | ------------- 1020 | 1021 | Lets see _if the emphasis 1022 | 1023 | carries over_ to __another__ paragraph. 1024 | 1025 | And ` maybe this ` should Hello not be 1026 | 1027 | > ### Header 1028 | > 1029 | > Header 1030 | > -------- 1031 | > 1032 | 1033 | - - - 1034 | 1035 | * List 0 1036 | * List 1037 | * Hello! 1038 | 1039 | Hello 1040 | 1041 | Item 2 1042 | Hello 1043 | 1044 | Hibuli habuli!*Code here* 1045 | 1046 | * Item 3 1047 | 1048 | * Hello again 1049 | 1050 | Hassd *code* 1051 | 1052 | Code here 1053 | 1054 | 1055 | 1056 | 1. Stuff 1057 | 1058 | Hello 1059 | 1060 | Markdown FTW! 1061 | 1062 | 1063 | 1986\. What a great season. A link here: that should be automatically detected. 1064 | 1065 | Stuff *here!*. This is pretty cool. 1066 | 1067 | * Hello 1068 | * Booboo 1069 | 1070 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 1071 | 1072 | 1. Stuff 1073 | 1. Hello 1074 | 9. Again 1075 | 3211233. Stuff 1076 | 1077 | This is [an example](http://example.com/ "Title") inline link. 1078 | 1079 | ![][googleimg] 1080 | 1081 | [googleimg]: http://www.google.com/images/nav_logo6.png 1082 | "Google!" 1083 | 1084 | ``Hello **`strong text** here`` 1085 | 1086 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 1087 | 1088 | # 2nd Headline 1089 | 1090 | Yeah. 1091 | 1092 | [name]: http://google.com 1093 | [foo1]: http://example.com/ "Optional Title Here" 1094 | [foo3]: http://example.com/ 1095 | "'Optional Title Here" 1096 | 1097 | 1098 | Some code 1099 | 1100 | 1101 | Third headline 1102 | ------------------- 1103 | Some stuff here... 1104 | 1105 | 1106 | 1107 | Hello! 1108 | ======= 1109 | 1110 | Another header 1111 | ------------- 1112 | 1113 | Lets see _if the emphasis 1114 | 1115 | carries over_ to __another__ paragraph. 1116 | 1117 | And ` maybe this ` should Hello not be 1118 | 1119 | > ### Header 1120 | > 1121 | > Header 1122 | > -------- 1123 | > 1124 | 1125 | - - - 1126 | 1127 | * List 0 1128 | * List 1129 | * Hello! 1130 | 1131 | Hello 1132 | 1133 | Item 2 1134 | Hello 1135 | 1136 | Hibuli habuli!*Code here* 1137 | 1138 | * Item 3 1139 | 1140 | * Hello again 1141 | 1142 | Hassd *code* 1143 | 1144 | Code here 1145 | 1146 | 1147 | 1148 | 1. Stuff 1149 | 1150 | Hello 1151 | 1152 | Markdown FTW! 1153 | 1154 | 1155 | 1986\. What a great season. A link here: that should be automatically detected. 1156 | 1157 | Stuff *here!*. This is pretty cool. 1158 | 1159 | * Hello 1160 | * Booboo 1161 | 1162 | What [up to the ][name] cats n dogs :) He*ll*o!! *Some emphasized* stuff here. A * star * has [born]. This * i dont know what*will happen. 1163 | 1164 | 1. Stuff 1165 | 1. Hello 1166 | 9. Again 1167 | 3211233. Stuff 1168 | 1169 | This is [an example](http://example.com/ "Title") inline link. 1170 | 1171 | ![][googleimg] 1172 | 1173 | [googleimg]: http://www.google.com/images/nav_logo6.png 1174 | "Google!" 1175 | 1176 | ``Hello **`strong text** here`` 1177 | 1178 | > These * should * not \*be\* selected. This* neither! *should be. This *neither should\* be* 1179 | 1180 | # 2nd Headline 1181 | 1182 | Yeah. 1183 | 1184 | [name]: http://google.com 1185 | [foo1]: http://example.com/ "Optional Title Here" 1186 | [foo3]: http://example.com/ 1187 | "'Optional Title Here" 1188 | 1189 | 1190 | Some code 1191 | 1192 | 1193 | Third headline 1194 | ------------------- 1195 | Some stuff here... 1196 | 1197 | 1198 | -------------------------------------------------------------------------------- /test/manual/bom.md: -------------------------------------------------------------------------------- 1 |  2 | _text_ähere_ asd 3 | 4 | ## Some _ätextö_ here. 出典: *フリー* 百科事典 5 | --------------------------------- 6 | 7 | * 科事 __典 ad 8 | asdd asd__ 科事典 9 | * 科事典 10 | * _files•••ystem path_ under which the app files will be put 11 | * Indented _first_ sub 12 | * Doubleindent **1.1** _with 13 | some wrapping_ highlights and [a link] 14 | (http://url.com "Title here") to boot! 15 | * Indented _second_ sub 16 | * Doubleindent **2.1** 17 | * Doubleindent **2.2** 18 | * The `path to` the Apache2 site config **file (that this 19 | task will create) for** this app deployment 20 | 21 | -------------------------------------------------------------------------------- /test/manual/complex-bquotes.md: -------------------------------------------------------------------------------- 1 | >> **Sooo** 2 | >> 3 | > Heading 4 | > ------- 5 | > 6 | > And paragraph 7 | > 8 | >>> * List item 1 9 | >>> * List item 2 10 | >>> * List item 3 11 | >>> 12 | >> Level 2 -------------------------------------------------------------------------------- /test/manual/complex-lists.md: -------------------------------------------------------------------------------- 1 | * list 2 | * at 3 | * start 4 | With 5 | * another 6 | * list 7 | * inside 8 | * shifted one 9 | * 1. Let 10 | 2. Here 11 | 3. Be 12 | 4. Numbers 13 | List continues 14 | 15 | With another paragraph 16 | * more 17 | 18 | ---- 19 | 20 | * Some text, multiline text though, Some text, multiline text *though*, Some text, multiline text though, & Some text, | multiline text though 21 | And no-space line 22 | 23 | May be a heading? 24 | 25 | ----- 26 | 27 | Yes? 28 | 29 | * Next item 30 | With 31 | Several 32 | Lines 33 | 34 | * Last item 35 | 36 | Hey-hey 37 | * + item 38 | * yes 39 | * here's two levels 40 | * next level 41 | * I suppose 42 | * Yep? 43 | * 1. item 44 | 2. item 2 45 | 3. item 3 46 | 47 | 4. item 48 | * inside 49 | * inside? 50 | * woo 51 | 5. item 52 | 53 | * one item before last 54 | 55 | * last item 56 | 57 | ---- 58 | 59 | 1. Ordered list 60 | With several lines,alhtough 61 | 1. An asterix * and *strong* inside 62 | 1. One more item 63 | 64 | 256. Woo 65 | 9. Back 66 | 67 | 12. Hey-hey 68 | 69 | * A bullet-list inside 70 | * Here 71 | * And here 72 | 73 | 13. simple item 74 | 75 | * And 76 | * One 77 | * More 78 | + Bullet 79 | - List 80 | - Yep 81 | 82 | ---- 83 | 84 | > ### Header 85 | 86 | > Header 87 | > -------- 88 | > Some text 89 | > Multi 90 | Lined 91 | Item 92 | 93 | >> Two-levelled 94 | >>> Three-levelled 95 | 96 | 3. aND ordered here 97 | 4. Yabadabadoo 98 | 99 | -------------------------------------------------------------------------------- /test/manual/empty.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shamansir/mdown-parse-pegjs/71bc330af58a5514e7e2d51504add68d814b5a10/test/manual/empty.md -------------------------------------------------------------------------------- /test/manual/from-gotchas-plain.md: -------------------------------------------------------------------------------- 1 | ##Header## 2 | 3 | ---------- 4 | 5 | Some **bold** Some *italic* and [a link][1] 6 | 7 | A little code sample 8 | 9 | 10 | Web Page Title 11 | 12 | 13 | A picture 14 | 15 | ![alt text][2] 16 | 17 | A list 18 | 19 | - apples 20 | - oranges 21 | - eggs 22 | 23 | A numbered list 24 | 25 | 1. a 26 | 2. b 27 | 3. c 28 | 29 | A little quote 30 | 31 | > It is now time for all good men to come to the aid of their country. 32 | 33 | A final paragraph. 34 | 35 | [1]: http://www.google.com 36 | [2]: http://www.google.com/intl/en_ALL/images/logo.gif -------------------------------------------------------------------------------- /test/manual/from-gotchas.md: -------------------------------------------------------------------------------- 1 | `some_file_name` 2 | 3 |
4 | This *won't* work. 5 |
-------------------------------------------------------------------------------- /test/manual/github-flavored-markdown.md: -------------------------------------------------------------------------------- 1 | GitHub Flavored Markdown 2 | ================================ 3 | 4 | *View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).* 5 | 6 | Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character: 7 | 8 | Roses are red 9 | Violets are blue 10 | 11 | The next paragraph has the same phrases, but now they are separated by two spaces and a newline character: 12 | 13 | Roses are red 14 | Violets are blue 15 | 16 | Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing. 17 | 18 | A bit of the GitHub spice 19 | ------------------------- 20 | 21 | In addition to the changes in the previous section, certain references are auto-linked: 22 | 23 | * SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 24 | * User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 25 | * User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2 26 | * \#Num: #1 27 | * User/#Num: mojombo#1 28 | * User/Project#Num: mojombo/god#1 29 | 30 | These are dangerous goodies though, and we need to make sure email addresses don't get mangled: 31 | 32 | My email addy is tom@github.com. 33 | 34 | Math is hard, let's go shopping 35 | ------------------------------- 36 | 37 | In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7. 38 | 39 | Triangles man! a^2 + b^2 = c^2 40 | 41 | We all like making lists 42 | ------------------------ 43 | 44 | The above header should be an H2 tag. Now, for a list of fruits: 45 | 46 | * Red Apples 47 | * Purple Grapes 48 | * Green Kiwifruits 49 | 50 | Let's get crazy: 51 | 52 | 1. This is a list item with two paragraphs. Lorem ipsum dolor 53 | sit amet, consectetuer adipiscing elit. Aliquam hendrerit 54 | mi posuere lectus. 55 | 56 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet 57 | vitae, risus. Donec sit amet nisl. Aliquam semper ipsum 58 | sit amet velit. 59 | 60 | 2. Suspendisse id sem consectetuer libero luctus adipiscing. 61 | 62 | What about some code **in** a list? That's insane, right? 63 | 64 | 1. In Ruby you can map like this: 65 | 66 | ['a', 'b'].map { |x| x.uppercase } 67 | 68 | 2. In Rails, you can do a shortcut: 69 | 70 | ['a', 'b'].map(&:uppercase) 71 | 72 | Some people seem to like definition lists 73 | 74 |
75 |
Lower cost
76 |
The new version of this product costs significantly less than the previous one!
77 |
Easier to use
78 |
We've changed the product so that it's much easier to use!
79 |
80 | 81 | I am a robot 82 | ------------ 83 | 84 | Maybe you want to print `robot` to the console 1000 times. Why not? 85 | 86 | def robot_invasion 87 | puts("robot " * 1000) 88 | end 89 | 90 | You see, that was formatted as code because it's been indented by four spaces. 91 | 92 | How about we throw some angle braces and ampersands in there? 93 | 94 | 97 | 98 | Set in stone 99 | ------------ 100 | 101 | Preformatted blocks are useful for ASCII art: 102 | 103 |
104 |              ,-. 
105 |     ,     ,-.   ,-. 
106 |    / \   (   )-(   ) 
107 |    \ |  ,.>-(   )-< 
108 |     \|,' (   )-(   ) 
109 |      Y ___`-'   `-' 
110 |      |/__/   `-' 
111 |      | 
112 |      | 
113 |      |    -hrr- 
114 |   ___|_____________ 
115 | 
116 | 117 | Playing the blame game 118 | ---------------------- 119 | 120 | If you need to blame someone, the best way to do so is by quoting them: 121 | 122 | > I, at any rate, am convinced that He does not throw dice. 123 | 124 | Or perhaps someone a little less eloquent: 125 | 126 | > I wish you'd have given me this written question ahead of time so I 127 | > could plan for it... I'm sure something will pop into my head here in 128 | > the midst of this press conference, with all the pressure of trying to 129 | > come up with answer, but it hadn't yet... 130 | > 131 | > I don't want to sound like 132 | > I have made no mistakes. I'm confident I have. I just haven't - you 133 | > just put me under the spot here, and maybe I'm not as quick on my feet 134 | > as I should be in coming up with one. 135 | 136 | Table for two 137 | ------------- 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 |
IDNameRank
1Tom Preston-WernerAwesome
2Albert EinsteinNearly as awesome
150 | 151 | Crazy linking action 152 | -------------------- 153 | 154 | I get 10 times more traffic from [Google] [1] than from 155 | [Yahoo] [2] or [MSN] [3]. 156 | 157 | [1]: http://google.com/ "Google" 158 | [2]: http://search.yahoo.com/ "Yahoo Search" 159 | [3]: http://search.msn.com/ "MSN Search" -------------------------------------------------------------------------------- /test/manual/links.md: -------------------------------------------------------------------------------- 1 | 2 | [one][1] and [two][2] and [three] [3] and [four][4] and [five][5] and [six][6] and [seven][7] and [eight][8] and [nine][9] and [ten][10]. 3 | 4 | [one][11] and [two][12] and [three] [13] and [four][14] and [five][15] and [six][16] and [seven][17] and [eight][18] and [nine][19] and [ten][20]. 5 | 6 | [one][21] and [two][22] and [three] [23] and [four][24] and [five][25] and [six][26] and [seven][27] and [eight][28] and [nine][29] and [ten][30]. 7 | 8 | [first][a] and [second][b] and [third][c] and [fourth][d] and [fifth][e] and [sixth][f] and [seventh][g] letters. 9 | 10 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. 11 | 12 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. 13 | 14 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. 15 | 16 | Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. Let's have some [bogus links][bogus] to make [the parser][xxx] search [the labels][notthere]. 17 | 18 | [1]: http://google.com 19 | [2]: http://google.com 20 | [3]: http://google.com 21 | [4]: http://google.com 22 | [5]: http://google.com 23 | [6]: http://google.com 24 | [7]: http://google.com 25 | [8]: http://google.com 26 | [9]: http://google.com 27 | [10]: http://google.com 28 | 29 | [11]: http://google.com 30 | [12]: http://google.com 31 | [13]: http://google.com 32 | [14]: http://google.com 33 | [15]: http://google.com 34 | [16]: http://google.com 35 | [17]: http://google.com 36 | [18]: http://google.com 37 | [19]: http://google.com 38 | [20]: http://google.com 39 | 40 | [21]: http://google.com 41 | [22]: http://google.com 42 | [23]: http://google.com 43 | [24]: http://google.com 44 | [25]: http://google.com 45 | [26]: http://google.com 46 | [27]: http://google.com 47 | [28]: http://google.com 48 | [29]: http://google.com 49 | [30]: http://google.com 50 | 51 | [a]: http://google.com 52 | [b]: http://google.com 53 | [c]: http://google.com 54 | [d]: http://google.com 55 | [e]: http://google.com 56 | 57 | -------------------------------------------------------------------------------- /test/manual/no_bom.md: -------------------------------------------------------------------------------- 1 | 2 | _text_ähere_ asd 3 | 4 | ## Some _ätextö_ here. 出典: *フリー* 百科事典 5 | --------------------------------- 6 | 7 | * 科事 __典 ad 8 | asdd asd__ 科事典 9 | * 科事典 10 | * _files•••ystem path_ under which the app files will be put 11 | * Indented _first_ sub 12 | * Doubleindent **1.1** _with 13 | some wrapping_ highlights and [a link] 14 | (http://url.com "Title here") to boot! 15 | * Indented _second_ sub 16 | * Doubleindent **2.1** 17 | * Doubleindent **2.2** 18 | * The `path to` the Apache2 site config **file (that this 19 | task will create) for** this app deployment 20 | 21 | -------------------------------------------------------------------------------- /test/manual/positions-tests.md: -------------------------------------------------------------------------------- 1 | ---------- 2 | 3 | * A list 4 | 5 | ### A title 6 | 7 | ---------- 8 | 9 | Another title 10 | ============= 11 | 12 | ------------- 13 | 14 | -------------------------------------------------------------------------------- /test/manual/progressing.md: -------------------------------------------------------------------------------- 1 | 1. List at start 2 | 3 | > With blockquote inside 4 | 5 | One 6 | ====== 7 | 8 | #### Four-levelled heading 9 | 10 | Block of code 11 | Must keep indent here { 12 | Woo-woo olo-lo 13 | some = & a + "join" 14 | } 15 | 16 | And it may contain spaces, of course 17 | 18 | ### Three-levelled 19 | 20 | ##### Five-levelled 21 | 22 | Some *another* paragraph 23 | With __two lines__ of text 碐 and some entities >< inside | 24 | 25 | ## Two-levelled 26 | 27 | # And one 28 | 29 | Some **paragraph** of _text_ and some `code a lot { }` inside, yep? 30 | 31 | Woo-Hoo 32 | ------- 33 | 34 | djjdjd 35 | 36 | > Here *is* another blockquote 37 | With several lines 38 | > Yes it is 39 | 40 | >> Two-level blockquote 41 | 42 | >>> Three-level blockquote 43 | 44 | A first paragraph inside the blockquote 45 | 46 | A second paragraph inside the blockquote 47 | 48 | ------ 49 | 50 | and the Verbatim inside the blockquote 51 | With some lines of code 52 | Yep 53 | 54 | Please keep indent here also 55 | 56 | { 57 | Mooooooo 58 | } 59 | 60 | A second paragraph inside the blockquote 61 | 62 | * A list inside the blockquote 63 | * The second item 64 | 65 | Paragraph 66 | 67 | And verbatim inside 68 | 69 | > Continues here 70 | 71 | 1. A list 72 | 2. A list with verbatim 73 | Long paragraph 74 | 75 | Second paragraph with several 76 | lines 77 | 78 | Third paragraph with both 79 | lines indented 80 | 81 | Some verbatim { 82 | return wooo; 83 | boo; 84 | } 85 | 86 | And **one** paragraph in the end 87 | 88 | 3. List continues 89 | 90 |
OHOHO
91 | 92 |
dkdjdjdwooo

WOOHOO

93 | 94 | 95 | 96 | 1. Ordered list 97 | With several lines,alhtough 98 | Line with 5 spaces at left 99 | Line with 4 spaces at left 100 | Line with 0 spaces at left 101 | 102 | And this is second paragraph of first item 103 | 104 | 1. An asterix * and *strong* inside 105 | 1. One more item 106 | 107 | 256. Woo 108 | 9. Back 109 | 110 | 12. Hey-hey 111 | 112 | * A bullet-list inside 113 | * Here 114 | * And here 115 | 116 | 13. simple item 117 | 118 | * And 119 | * One 120 | * More 121 | + Bullet 122 | - List 123 | - Yep 124 | 125 | > ### Header 126 | 127 | > Header 128 | -------- 129 | Some text 130 | 131 | > More... 132 | 133 | 3. aND ordered here 134 | 4. Yabadabadoo 135 | 136 | Heading with paragraph below 137 | =========== 138 | akksksk 139 | 140 | Heading with no paragraph below 141 | =========== 142 | 143 | -------------------------------------------------------------------------------- /test/manual/single-list-test.md: -------------------------------------------------------------------------------- 1 | * List item 1 2 | * List item 2 3 | * List item 3 -------------------------------------------------------------------------------- /test/manual/spaces.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/manual/spacesnewlines.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test/mdtest1.1/License.text: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Amps and angle encoding.text: -------------------------------------------------------------------------------- 1 | AT&T has an ampersand in their name. 2 | 3 | AT&T is another way to write it. 4 | 5 | This & that. 6 | 7 | 4 < 5. 8 | 9 | 6 > 5. 10 | 11 | Here's a [link] [1] with an ampersand in the URL. 12 | 13 | Here's a link with an amersand in the link text: [AT&T] [2]. 14 | 15 | Here's an inline [link](/script?foo=1&bar=2). 16 | 17 | Here's an inline [link](). 18 | 19 | 20 | [1]: http://example.com/?foo=1&bar=2 21 | [2]: http://att.com/ "AT&T" -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Amps and angle encoding.xhtml: -------------------------------------------------------------------------------- 1 |

AT&T has an ampersand in their name.

2 | 3 |

AT&T is another way to write it.

4 | 5 |

This & that.

6 | 7 |

4 < 5.

8 | 9 |

6 > 5.

10 | 11 |

Here's a link with an ampersand in the URL.

12 | 13 |

Here's a link with an amersand in the link text: AT&T.

14 | 15 |

Here's an inline link.

16 | 17 |

Here's an inline link.

18 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Auto links.text: -------------------------------------------------------------------------------- 1 | Link: . 2 | 3 | With an ampersand: 4 | 5 | * In a list? 6 | * 7 | * It should. 8 | 9 | > Blockquoted: 10 | 11 | Auto-links should not occur here: `` 12 | 13 | or here: -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Auto links.xhtml: -------------------------------------------------------------------------------- 1 |

Link: http://example.com/.

2 | 3 |

With an ampersand: http://example.com/?foo=1&bar=2

4 | 5 | 10 | 11 |
12 |

Blockquoted: http://example.com/

13 |
14 | 15 |

Auto-links should not occur here: <http://example.com/>

16 | 17 |
or here: <http://example.com/>
18 | 
19 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Backslash escapes.text: -------------------------------------------------------------------------------- 1 | These should all get escaped: 2 | 3 | Backslash: \\ 4 | 5 | Backtick: \` 6 | 7 | Asterisk: \* 8 | 9 | Underscore: \_ 10 | 11 | Left brace: \{ 12 | 13 | Right brace: \} 14 | 15 | Left bracket: \[ 16 | 17 | Right bracket: \] 18 | 19 | Left paren: \( 20 | 21 | Right paren: \) 22 | 23 | Greater-than: \> 24 | 25 | Hash: \# 26 | 27 | Period: \. 28 | 29 | Bang: \! 30 | 31 | Plus: \+ 32 | 33 | Minus: \- 34 | 35 | 36 | 37 | These should not, because they occur within a code block: 38 | 39 | Backslash: \\ 40 | 41 | Backtick: \` 42 | 43 | Asterisk: \* 44 | 45 | Underscore: \_ 46 | 47 | Left brace: \{ 48 | 49 | Right brace: \} 50 | 51 | Left bracket: \[ 52 | 53 | Right bracket: \] 54 | 55 | Left paren: \( 56 | 57 | Right paren: \) 58 | 59 | Greater-than: \> 60 | 61 | Hash: \# 62 | 63 | Period: \. 64 | 65 | Bang: \! 66 | 67 | Plus: \+ 68 | 69 | Minus: \- 70 | 71 | 72 | Nor should these, which occur in code spans: 73 | 74 | Backslash: `\\` 75 | 76 | Backtick: `` \` `` 77 | 78 | Asterisk: `\*` 79 | 80 | Underscore: `\_` 81 | 82 | Left brace: `\{` 83 | 84 | Right brace: `\}` 85 | 86 | Left bracket: `\[` 87 | 88 | Right bracket: `\]` 89 | 90 | Left paren: `\(` 91 | 92 | Right paren: `\)` 93 | 94 | Greater-than: `\>` 95 | 96 | Hash: `\#` 97 | 98 | Period: `\.` 99 | 100 | Bang: `\!` 101 | 102 | Plus: `\+` 103 | 104 | Minus: `\-` 105 | 106 | 107 | These should get escaped, even though they're matching pairs for 108 | other Markdown constructs: 109 | 110 | \*asterisks\* 111 | 112 | \_underscores\_ 113 | 114 | \`backticks\` 115 | 116 | This is a code span with a literal backslash-backtick sequence: `` \` `` 117 | 118 | This is a tag with unescaped backticks bar. 119 | 120 | This is a tag with backslashes bar. 121 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Backslash escapes.xhtml: -------------------------------------------------------------------------------- 1 |

These should all get escaped:

2 | 3 |

Backslash: \

4 | 5 |

Backtick: `

6 | 7 |

Asterisk: *

8 | 9 |

Underscore: _

10 | 11 |

Left brace: {

12 | 13 |

Right brace: }

14 | 15 |

Left bracket: [

16 | 17 |

Right bracket: ]

18 | 19 |

Left paren: (

20 | 21 |

Right paren: )

22 | 23 |

Greater-than: >

24 | 25 |

Hash: #

26 | 27 |

Period: .

28 | 29 |

Bang: !

30 | 31 |

Plus: +

32 | 33 |

Minus: -

34 | 35 |

These should not, because they occur within a code block:

36 | 37 |
Backslash: \\
 38 | 
 39 | Backtick: \`
 40 | 
 41 | Asterisk: \*
 42 | 
 43 | Underscore: \_
 44 | 
 45 | Left brace: \{
 46 | 
 47 | Right brace: \}
 48 | 
 49 | Left bracket: \[
 50 | 
 51 | Right bracket: \]
 52 | 
 53 | Left paren: \(
 54 | 
 55 | Right paren: \)
 56 | 
 57 | Greater-than: \>
 58 | 
 59 | Hash: \#
 60 | 
 61 | Period: \.
 62 | 
 63 | Bang: \!
 64 | 
 65 | Plus: \+
 66 | 
 67 | Minus: \-
 68 | 
69 | 70 |

Nor should these, which occur in code spans:

71 | 72 |

Backslash: \\

73 | 74 |

Backtick: \`

75 | 76 |

Asterisk: \*

77 | 78 |

Underscore: \_

79 | 80 |

Left brace: \{

81 | 82 |

Right brace: \}

83 | 84 |

Left bracket: \[

85 | 86 |

Right bracket: \]

87 | 88 |

Left paren: \(

89 | 90 |

Right paren: \)

91 | 92 |

Greater-than: \>

93 | 94 |

Hash: \#

95 | 96 |

Period: \.

97 | 98 |

Bang: \!

99 | 100 |

Plus: \+

101 | 102 |

Minus: \-

103 | 104 | 105 |

These should get escaped, even though they're matching pairs for 106 | other Markdown constructs:

107 | 108 |

*asterisks*

109 | 110 |

_underscores_

111 | 112 |

`backticks`

113 | 114 |

This is a code span with a literal backslash-backtick sequence: \`

115 | 116 |

This is a tag with unescaped backticks bar.

117 | 118 |

This is a tag with backslashes bar.

119 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Blockquotes with code blocks.text: -------------------------------------------------------------------------------- 1 | > Example: 2 | > 3 | > sub status { 4 | > print "working"; 5 | > } 6 | > 7 | > Or: 8 | > 9 | > sub status { 10 | > return "working"; 11 | > } 12 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Blockquotes with code blocks.xhtml: -------------------------------------------------------------------------------- 1 |
2 |

Example:

3 | 4 |
sub status {
 5 |     print "working";
 6 | }
 7 | 
8 | 9 |

Or:

10 | 11 |
sub status {
12 |     return "working";
13 | }
14 | 
15 |
16 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Code Blocks.text: -------------------------------------------------------------------------------- 1 | code block on the first line 2 | 3 | Regular text. 4 | 5 | code block indented by spaces 6 | 7 | Regular text. 8 | 9 | the lines in this block 10 | all contain trailing spaces 11 | 12 | Regular Text. 13 | 14 | code block on the last line -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Code Blocks.xhtml: -------------------------------------------------------------------------------- 1 |
code block on the first line
 2 | 
3 | 4 |

Regular text.

5 | 6 |
code block indented by spaces
 7 | 
8 | 9 |

Regular text.

10 | 11 |
the lines in this block  
12 | all contain trailing spaces  
13 | 
14 | 15 |

Regular Text.

16 | 17 |
code block on the last line
18 | 
19 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Code Spans.text: -------------------------------------------------------------------------------- 1 | `` 2 | 3 | Fix for backticks within HTML tag: like this 4 | 5 | Here's how you put `` `backticks` `` in a code span. -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Code Spans.xhtml: -------------------------------------------------------------------------------- 1 |

<test a=" content of attribute ">

2 | 3 |

Fix for backticks within HTML tag: like this

4 | 5 |

Here's how you put `backticks` in a code span.

6 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Hard-wrapped paragraphs with list-like lines.text: -------------------------------------------------------------------------------- 1 | In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item. 6 | 7 | Here's one with a bullet. 8 | * criminey. 9 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Hard-wrapped paragraphs with list-like lines.xhtml: -------------------------------------------------------------------------------- 1 |

In Markdown 1.0.0 and earlier. Version 2 | 8. This line turns into a list item. 3 | Because a hard-wrapped line in the 4 | middle of a paragraph looked like a 5 | list item.

6 | 7 |

Here's one with a bullet. 8 | * criminey.

9 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Horizontal rules.text: -------------------------------------------------------------------------------- 1 | Dashes: 2 | 3 | --- 4 | 5 | --- 6 | 7 | --- 8 | 9 | --- 10 | 11 | --- 12 | 13 | - - - 14 | 15 | - - - 16 | 17 | - - - 18 | 19 | - - - 20 | 21 | - - - 22 | 23 | 24 | Asterisks: 25 | 26 | *** 27 | 28 | *** 29 | 30 | *** 31 | 32 | *** 33 | 34 | *** 35 | 36 | * * * 37 | 38 | * * * 39 | 40 | * * * 41 | 42 | * * * 43 | 44 | * * * 45 | 46 | 47 | Underscores: 48 | 49 | ___ 50 | 51 | ___ 52 | 53 | ___ 54 | 55 | ___ 56 | 57 | ___ 58 | 59 | _ _ _ 60 | 61 | _ _ _ 62 | 63 | _ _ _ 64 | 65 | _ _ _ 66 | 67 | _ _ _ 68 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Horizontal rules.xhtml: -------------------------------------------------------------------------------- 1 |

Dashes:

2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 |
---
12 | 
13 | 14 |
15 | 16 |
17 | 18 |
19 | 20 |
21 | 22 |
- - -
23 | 
24 | 25 |

Asterisks:

26 | 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 | 35 |
***
36 | 
37 | 38 |
39 | 40 |
41 | 42 |
43 | 44 |
45 | 46 |
* * *
47 | 
48 | 49 |

Underscores:

50 | 51 |
52 | 53 |
54 | 55 |
56 | 57 |
58 | 59 |
___
60 | 
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
_ _ _
71 | 
72 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Images.text: -------------------------------------------------------------------------------- 1 | ![Alt text](/path/to/img.jpg) 2 | 3 | ![Alt text](/path/to/img.jpg "Optional title") 4 | 5 | Inline within a paragraph: [alt text](/url/). 6 | 7 | ![alt text](/url/ "title preceded by two spaces") 8 | 9 | ![alt text](/url/ "title has spaces afterward" ) 10 | 11 | ![alt text]() 12 | 13 | ![alt text]( "with a title"). 14 | 15 | ![Empty]() 16 | 17 | ![this is a stupid URL](http://example.com/(parens).jpg) 18 | 19 | 20 | ![alt text][foo] 21 | 22 | [foo]: /url/ 23 | 24 | ![alt text][bar] 25 | 26 | [bar]: /url/ "Title here" -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Images.xhtml: -------------------------------------------------------------------------------- 1 |

Alt text

2 | 3 |

Alt text

4 | 5 |

Inline within a paragraph: alt text.

6 | 7 |

alt text

8 | 9 |

alt text

10 | 11 |

alt text

12 | 13 |

alt text.

14 | 15 |

Empty

16 | 17 |

this is a stupid URL

18 | 19 |

alt text

20 | 21 |

alt text

22 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Inline HTML (Advanced).text: -------------------------------------------------------------------------------- 1 | Simple block on one line: 2 | 3 |
foo
4 | 5 | And nested without indentation: 6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | 17 | And with attributes: 18 | 19 |
20 |
21 |
22 |
23 | 24 | This was broken in 1.0.2b7: 25 | 26 |
27 |
28 | foo 29 |
30 |
31 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Inline HTML (Advanced).xhtml: -------------------------------------------------------------------------------- 1 |

Simple block on one line:

2 | 3 |
foo
4 | 5 |

And nested without indentation:

6 | 7 |
8 |
9 |
10 | foo 11 |
12 |
13 |
14 |
bar
15 |
16 | 17 |

And with attributes:

18 | 19 |
20 |
21 |
22 |
23 | 24 |

This was broken in 1.0.2b7:

25 | 26 |
27 |
28 | foo 29 |
30 |
31 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Inline HTML (Simple).html: -------------------------------------------------------------------------------- 1 |

Here's a simple block:

2 | 3 |
4 | foo 5 |
6 | 7 |

This should be a code block, though:

8 | 9 |
<div>
10 |     foo
11 | </div>
12 | 
13 | 14 |

As should this:

15 | 16 |
<div>foo</div>
17 | 
18 | 19 |

Now, nested:

20 | 21 |
22 |
23 |
24 | foo 25 |
26 |
27 |
28 | 29 |

This should just be an HTML comment:

30 | 31 | 32 | 33 |

Multiline:

34 | 35 | 39 | 40 |

Code block:

41 | 42 |
<!-- Comment -->
43 | 
44 | 45 |

Just plain comment, with trailing spaces on the line:

46 | 47 | 48 | 49 |

Code:

50 | 51 |
<hr />
52 | 
53 | 54 |

Hr's:

55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 |
73 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Inline HTML (Simple).text: -------------------------------------------------------------------------------- 1 | Here's a simple block: 2 | 3 |
4 | foo 5 |
6 | 7 | This should be a code block, though: 8 | 9 |
10 | foo 11 |
12 | 13 | As should this: 14 | 15 |
foo
16 | 17 | Now, nested: 18 | 19 |
20 |
21 |
22 | foo 23 |
24 |
25 |
26 | 27 | This should just be an HTML comment: 28 | 29 | 30 | 31 | Multiline: 32 | 33 | 37 | 38 | Code block: 39 | 40 | 41 | 42 | Just plain comment, with trailing spaces on the line: 43 | 44 | 45 | 46 | Code: 47 | 48 |
49 | 50 | Hr's: 51 | 52 |
53 | 54 |
55 | 56 |
57 | 58 |
59 | 60 |
61 | 62 |
63 | 64 |
65 | 66 |
67 | 68 |
69 | 70 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Inline HTML comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

2 | 3 | 4 | 5 | 8 | 9 |

Paragraph two.

10 | 11 | 12 | 13 |

The end.

14 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Inline HTML comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Links, inline style.text: -------------------------------------------------------------------------------- 1 | Just a [URL](/url/). 2 | 3 | [URL and title](/url/ "title"). 4 | 5 | [URL and title](/url/ "title preceded by two spaces"). 6 | 7 | [URL and title](/url/ "title preceded by a tab"). 8 | 9 | [URL and title](/url/ "title has spaces afterward" ). 10 | 11 | [URL wrapped in angle brackets](). 12 | 13 | [URL w/ angle brackets + title]( "Here's the title"). 14 | 15 | [Empty](). 16 | 17 | [With parens in the URL](http://en.wikipedia.org/wiki/WIMP_(computing)) 18 | 19 | (With outer parens and [parens in url](/foo(bar))) 20 | 21 | 22 | [With parens in the URL](/foo(bar) "and a title") 23 | 24 | (With outer parens and [parens in url](/foo(bar) "and a title")) 25 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Links, inline style.xhtml: -------------------------------------------------------------------------------- 1 |

Just a URL.

2 | 3 |

URL and title.

4 | 5 |

URL and title.

6 | 7 |

URL and title.

8 | 9 |

URL and title.

10 | 11 |

URL wrapped in angle brackets.

12 | 13 |

URL w/ angle brackets + title.

14 | 15 |

Empty.

16 | 17 |

With parens in the URL

18 | 19 |

(With outer parens and parens in url)

20 | 21 |

With parens in the URL

22 | 23 |

(With outer parens and parens in url)

24 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Links, reference style.text: -------------------------------------------------------------------------------- 1 | Foo [bar] [1]. 2 | 3 | Foo [bar][1]. 4 | 5 | Foo [bar] 6 | [1]. 7 | 8 | [1]: /url/ "Title" 9 | 10 | 11 | With [embedded [brackets]] [b]. 12 | 13 | 14 | Indented [once][]. 15 | 16 | Indented [twice][]. 17 | 18 | Indented [thrice][]. 19 | 20 | Indented [four][] times. 21 | 22 | [once]: /url 23 | 24 | [twice]: /url 25 | 26 | [thrice]: /url 27 | 28 | [four]: /url 29 | 30 | 31 | [b]: /url/ 32 | 33 | * * * 34 | 35 | [this] [this] should work 36 | 37 | So should [this][this]. 38 | 39 | And [this] []. 40 | 41 | And [this][]. 42 | 43 | And [this]. 44 | 45 | But not [that] []. 46 | 47 | Nor [that][]. 48 | 49 | Nor [that]. 50 | 51 | [Something in brackets like [this][] should work] 52 | 53 | [Same with [this].] 54 | 55 | In this case, [this](/somethingelse/) points to something else. 56 | 57 | Backslashing should suppress \[this] and [this\]. 58 | 59 | [this]: foo 60 | 61 | 62 | * * * 63 | 64 | Here's one where the [link 65 | breaks] across lines. 66 | 67 | Here's another where the [link 68 | breaks] across lines, but with a line-ending space. 69 | 70 | 71 | [link breaks]: /url/ 72 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Links, reference style.xhtml: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | 5 |

Foo bar.

6 | 7 |

With embedded [brackets].

8 | 9 |

Indented once.

10 | 11 |

Indented twice.

12 | 13 |

Indented thrice.

14 | 15 |

Indented [four][] times.

16 | 17 |
[four]: /url
18 | 
19 | 20 |
21 | 22 |

this should work

23 | 24 |

So should this.

25 | 26 |

And this.

27 | 28 |

And this.

29 | 30 |

And this.

31 | 32 |

But not [that] [].

33 | 34 |

Nor [that][].

35 | 36 |

Nor [that].

37 | 38 |

[Something in brackets like this should work]

39 | 40 |

[Same with this.]

41 | 42 |

In this case, this points to something else.

43 | 44 |

Backslashing should suppress [this] and [this].

45 | 46 |
47 | 48 |

Here's one where the link 49 | breaks across lines.

50 | 51 |

Here's another where the link 52 | breaks across lines, but with a line-ending space.

53 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Links, shortcut references.text: -------------------------------------------------------------------------------- 1 | This is the [simple case]. 2 | 3 | [simple case]: /simple 4 | 5 | 6 | 7 | This one has a [line 8 | break]. 9 | 10 | This one has a [line 11 | break] with a line-ending space. 12 | 13 | [line break]: /foo 14 | 15 | 16 | [this] [that] and the [other] 17 | 18 | [this]: /this 19 | [that]: /that 20 | [other]: /other 21 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Links, shortcut references.xhtml: -------------------------------------------------------------------------------- 1 |

This is the simple case.

2 | 3 |

This one has a line 4 | break.

5 | 6 |

This one has a line 7 | break with a line-ending space.

8 | 9 |

this and the other

10 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Literal quotes in titles.text: -------------------------------------------------------------------------------- 1 | Foo [bar][]. 2 | 3 | Foo [bar](/url/ "Title with "quotes" inside"). 4 | 5 | 6 | [bar]: /url/ "Title with "quotes" inside" 7 | 8 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Literal quotes in titles.xhtml: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Markdown Documentation - Basics.text: -------------------------------------------------------------------------------- 1 | Markdown: Basics 2 | ================ 3 | 4 | 11 | 12 | 13 | Getting the Gist of Markdown's Formatting Syntax 14 | ------------------------------------------------ 15 | 16 | This page offers a brief overview of what it's like to use Markdown. 17 | The [syntax page] [s] provides complete, detailed documentation for 18 | every feature, but Markdown should be very easy to pick up simply by 19 | looking at a few examples of it in action. The examples on this page 20 | are written in a before/after style, showing example syntax and the 21 | HTML output produced by Markdown. 22 | 23 | It's also helpful to simply try Markdown out; the [Dingus] [d] is a 24 | web application that allows you type your own Markdown-formatted text 25 | and translate it to XHTML. 26 | 27 | **Note:** This document is itself written using Markdown; you 28 | can [see the source for it by adding '.text' to the URL] [src]. 29 | 30 | [s]: /projects/markdown/syntax "Markdown Syntax" 31 | [d]: /projects/markdown/dingus "Markdown Dingus" 32 | [src]: /projects/markdown/basics.text 33 | 34 | 35 | ## Paragraphs, Headers, Blockquotes ## 36 | 37 | A paragraph is simply one or more consecutive lines of text, separated 38 | by one or more blank lines. (A blank line is any line that looks like a 39 | blank line -- a line containing nothing spaces or tabs is considered 40 | blank.) Normal paragraphs should not be intended with spaces or tabs. 41 | 42 | Markdown offers two styles of headers: *Setext* and *atx*. 43 | Setext-style headers for `

` and `

` are created by 44 | "underlining" with equal signs (`=`) and hyphens (`-`), respectively. 45 | To create an atx-style header, you put 1-6 hash marks (`#`) at the 46 | beginning of the line -- the number of hashes equals the resulting 47 | HTML header level. 48 | 49 | Blockquotes are indicated using email-style '`>`' angle brackets. 50 | 51 | Markdown: 52 | 53 | A First Level Header 54 | ==================== 55 | 56 | A Second Level Header 57 | --------------------- 58 | 59 | Now is the time for all good men to come to 60 | the aid of their country. This is just a 61 | regular paragraph. 62 | 63 | The quick brown fox jumped over the lazy 64 | dog's back. 65 | 66 | ### Header 3 67 | 68 | > This is a blockquote. 69 | > 70 | > This is the second paragraph in the blockquote. 71 | > 72 | > ## This is an H2 in a blockquote 73 | 74 | 75 | Output: 76 | 77 |

A First Level Header

78 | 79 |

A Second Level Header

80 | 81 |

Now is the time for all good men to come to 82 | the aid of their country. This is just a 83 | regular paragraph.

84 | 85 |

The quick brown fox jumped over the lazy 86 | dog's back.

87 | 88 |

Header 3

89 | 90 |
91 |

This is a blockquote.

92 | 93 |

This is the second paragraph in the blockquote.

94 | 95 |

This is an H2 in a blockquote

96 |
97 | 98 | 99 | 100 | ### Phrase Emphasis ### 101 | 102 | Markdown uses asterisks and underscores to indicate spans of emphasis. 103 | 104 | Markdown: 105 | 106 | Some of these words *are emphasized*. 107 | Some of these words _are emphasized also_. 108 | 109 | Use two asterisks for **strong emphasis**. 110 | Or, if you prefer, __use two underscores instead__. 111 | 112 | Output: 113 | 114 |

Some of these words are emphasized. 115 | Some of these words are emphasized also.

116 | 117 |

Use two asterisks for strong emphasis. 118 | Or, if you prefer, use two underscores instead.

119 | 120 | 121 | 122 | ## Lists ## 123 | 124 | Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, 125 | `+`, and `-`) as list markers. These three markers are 126 | interchangable; this: 127 | 128 | * Candy. 129 | * Gum. 130 | * Booze. 131 | 132 | this: 133 | 134 | + Candy. 135 | + Gum. 136 | + Booze. 137 | 138 | and this: 139 | 140 | - Candy. 141 | - Gum. 142 | - Booze. 143 | 144 | all produce the same output: 145 | 146 |
    147 |
  • Candy.
  • 148 |
  • Gum.
  • 149 |
  • Booze.
  • 150 |
151 | 152 | Ordered (numbered) lists use regular numbers, followed by periods, as 153 | list markers: 154 | 155 | 1. Red 156 | 2. Green 157 | 3. Blue 158 | 159 | Output: 160 | 161 |
    162 |
  1. Red
  2. 163 |
  3. Green
  4. 164 |
  5. Blue
  6. 165 |
166 | 167 | If you put blank lines between items, you'll get `

` tags for the 168 | list item text. You can create multi-paragraph list items by indenting 169 | the paragraphs by 4 spaces or 1 tab: 170 | 171 | * A list item. 172 | 173 | With multiple paragraphs. 174 | 175 | * Another item in the list. 176 | 177 | Output: 178 | 179 |

    180 |
  • A list item.

    181 |

    With multiple paragraphs.

  • 182 |
  • Another item in the list.

  • 183 |
184 | 185 | 186 | 187 | ### Links ### 188 | 189 | Markdown supports two styles for creating links: *inline* and 190 | *reference*. With both styles, you use square brackets to delimit the 191 | text you want to turn into a link. 192 | 193 | Inline-style links use parentheses immediately after the link text. 194 | For example: 195 | 196 | This is an [example link](http://example.com/). 197 | 198 | Output: 199 | 200 |

This is an 201 | example link.

202 | 203 | Optionally, you may include a title attribute in the parentheses: 204 | 205 | This is an [example link](http://example.com/ "With a Title"). 206 | 207 | Output: 208 | 209 |

This is an 210 | example link.

211 | 212 | Reference-style links allow you to refer to your links by names, which 213 | you define elsewhere in your document: 214 | 215 | I get 10 times more traffic from [Google][1] than from 216 | [Yahoo][2] or [MSN][3]. 217 | 218 | [1]: http://google.com/ "Google" 219 | [2]: http://search.yahoo.com/ "Yahoo Search" 220 | [3]: http://search.msn.com/ "MSN Search" 221 | 222 | Output: 223 | 224 |

I get 10 times more traffic from Google than from Yahoo or MSN.

228 | 229 | The title attribute is optional. Link names may contain letters, 230 | numbers and spaces, but are *not* case sensitive: 231 | 232 | I start my morning with a cup of coffee and 233 | [The New York Times][NY Times]. 234 | 235 | [ny times]: http://www.nytimes.com/ 236 | 237 | Output: 238 | 239 |

I start my morning with a cup of coffee and 240 | The New York Times.

241 | 242 | 243 | ### Images ### 244 | 245 | Image syntax is very much like link syntax. 246 | 247 | Inline (titles are optional): 248 | 249 | ![alt text](/path/to/img.jpg "Title") 250 | 251 | Reference-style: 252 | 253 | ![alt text][id] 254 | 255 | [id]: /path/to/img.jpg "Title" 256 | 257 | Both of the above examples produce the same output: 258 | 259 | alt text 260 | 261 | 262 | 263 | ### Code ### 264 | 265 | In a regular paragraph, you can create code span by wrapping text in 266 | backtick quotes. Any ampersands (`&`) and angle brackets (`<` or 267 | `>`) will automatically be translated into HTML entities. This makes 268 | it easy to use Markdown to write about HTML example code: 269 | 270 | I strongly recommend against using any `` tags. 271 | 272 | I wish SmartyPants used named entities like `—` 273 | instead of decimal-encoded entites like `—`. 274 | 275 | Output: 276 | 277 |

I strongly recommend against using any 278 | <blink> tags.

279 | 280 |

I wish SmartyPants used named entities like 281 | &mdash; instead of decimal-encoded 282 | entites like &#8212;.

283 | 284 | 285 | To specify an entire block of pre-formatted code, indent every line of 286 | the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, 287 | and `>` characters will be escaped automatically. 288 | 289 | Markdown: 290 | 291 | If you want your page to validate under XHTML 1.0 Strict, 292 | you've got to put paragraph tags in your blockquotes: 293 | 294 |
295 |

For example.

296 |
297 | 298 | Output: 299 | 300 |

If you want your page to validate under XHTML 1.0 Strict, 301 | you've got to put paragraph tags in your blockquotes:

302 | 303 |
<blockquote>
304 |         <p>For example.</p>
305 |     </blockquote>
306 |     
307 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Markdown Documentation - Basics.xhtml: -------------------------------------------------------------------------------- 1 |

Markdown: Basics

2 | 3 | 10 | 11 |

Getting the Gist of Markdown's Formatting Syntax

12 | 13 |

This page offers a brief overview of what it's like to use Markdown. 14 | The syntax page provides complete, detailed documentation for 15 | every feature, but Markdown should be very easy to pick up simply by 16 | looking at a few examples of it in action. The examples on this page 17 | are written in a before/after style, showing example syntax and the 18 | HTML output produced by Markdown.

19 | 20 |

It's also helpful to simply try Markdown out; the Dingus is a 21 | web application that allows you type your own Markdown-formatted text 22 | and translate it to XHTML.

23 | 24 |

Note: This document is itself written using Markdown; you 25 | can see the source for it by adding '.text' to the URL.

26 | 27 |

Paragraphs, Headers, Blockquotes

28 | 29 |

A paragraph is simply one or more consecutive lines of text, separated 30 | by one or more blank lines. (A blank line is any line that looks like a 31 | blank line -- a line containing nothing spaces or tabs is considered 32 | blank.) Normal paragraphs should not be intended with spaces or tabs.

33 | 34 |

Markdown offers two styles of headers: Setext and atx. 35 | Setext-style headers for <h1> and <h2> are created by 36 | "underlining" with equal signs (=) and hyphens (-), respectively. 37 | To create an atx-style header, you put 1-6 hash marks (#) at the 38 | beginning of the line -- the number of hashes equals the resulting 39 | HTML header level.

40 | 41 |

Blockquotes are indicated using email-style '>' angle brackets.

42 | 43 |

Markdown:

44 | 45 |
A First Level Header
 46 | ====================
 47 | 
 48 | A Second Level Header
 49 | ---------------------
 50 | 
 51 | Now is the time for all good men to come to
 52 | the aid of their country. This is just a
 53 | regular paragraph.
 54 | 
 55 | The quick brown fox jumped over the lazy
 56 | dog's back.
 57 | 
 58 | ### Header 3
 59 | 
 60 | > This is a blockquote.
 61 | > 
 62 | > This is the second paragraph in the blockquote.
 63 | >
 64 | > ## This is an H2 in a blockquote
 65 | 
66 | 67 |

Output:

68 | 69 |
<h1>A First Level Header</h1>
 70 | 
 71 | <h2>A Second Level Header</h2>
 72 | 
 73 | <p>Now is the time for all good men to come to
 74 | the aid of their country. This is just a
 75 | regular paragraph.</p>
 76 | 
 77 | <p>The quick brown fox jumped over the lazy
 78 | dog's back.</p>
 79 | 
 80 | <h3>Header 3</h3>
 81 | 
 82 | <blockquote>
 83 |     <p>This is a blockquote.</p>
 84 | 
 85 |     <p>This is the second paragraph in the blockquote.</p>
 86 | 
 87 |     <h2>This is an H2 in a blockquote</h2>
 88 | </blockquote>
 89 | 
90 | 91 |

Phrase Emphasis

92 | 93 |

Markdown uses asterisks and underscores to indicate spans of emphasis.

94 | 95 |

Markdown:

96 | 97 |
Some of these words *are emphasized*.
 98 | Some of these words _are emphasized also_.
 99 | 
100 | Use two asterisks for **strong emphasis**.
101 | Or, if you prefer, __use two underscores instead__.
102 | 
103 | 104 |

Output:

105 | 106 |
<p>Some of these words <em>are emphasized</em>.
107 | Some of these words <em>are emphasized also</em>.</p>
108 | 
109 | <p>Use two asterisks for <strong>strong emphasis</strong>.
110 | Or, if you prefer, <strong>use two underscores instead</strong>.</p>
111 | 
112 | 113 |

Lists

114 | 115 |

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, 116 | +, and -) as list markers. These three markers are 117 | interchangable; this:

118 | 119 |
*   Candy.
120 | *   Gum.
121 | *   Booze.
122 | 
123 | 124 |

this:

125 | 126 |
+   Candy.
127 | +   Gum.
128 | +   Booze.
129 | 
130 | 131 |

and this:

132 | 133 |
-   Candy.
134 | -   Gum.
135 | -   Booze.
136 | 
137 | 138 |

all produce the same output:

139 | 140 |
<ul>
141 | <li>Candy.</li>
142 | <li>Gum.</li>
143 | <li>Booze.</li>
144 | </ul>
145 | 
146 | 147 |

Ordered (numbered) lists use regular numbers, followed by periods, as 148 | list markers:

149 | 150 |
1.  Red
151 | 2.  Green
152 | 3.  Blue
153 | 
154 | 155 |

Output:

156 | 157 |
<ol>
158 | <li>Red</li>
159 | <li>Green</li>
160 | <li>Blue</li>
161 | </ol>
162 | 
163 | 164 |

If you put blank lines between items, you'll get <p> tags for the 165 | list item text. You can create multi-paragraph list items by indenting 166 | the paragraphs by 4 spaces or 1 tab:

167 | 168 |
*   A list item.
169 | 
170 |     With multiple paragraphs.
171 | 
172 | *   Another item in the list.
173 | 
174 | 175 |

Output:

176 | 177 |
<ul>
178 | <li><p>A list item.</p>
179 | <p>With multiple paragraphs.</p></li>
180 | <li><p>Another item in the list.</p></li>
181 | </ul>
182 | 
183 | 184 |

Links

185 | 186 |

Markdown supports two styles for creating links: inline and 187 | reference. With both styles, you use square brackets to delimit the 188 | text you want to turn into a link.

189 | 190 |

Inline-style links use parentheses immediately after the link text. 191 | For example:

192 | 193 |
This is an [example link](http://example.com/).
194 | 
195 | 196 |

Output:

197 | 198 |
<p>This is an <a href="http://example.com/">
199 | example link</a>.</p>
200 | 
201 | 202 |

Optionally, you may include a title attribute in the parentheses:

203 | 204 |
This is an [example link](http://example.com/ "With a Title").
205 | 
206 | 207 |

Output:

208 | 209 |
<p>This is an <a href="http://example.com/" title="With a Title">
210 | example link</a>.</p>
211 | 
212 | 213 |

Reference-style links allow you to refer to your links by names, which 214 | you define elsewhere in your document:

215 | 216 |
I get 10 times more traffic from [Google][1] than from
217 | [Yahoo][2] or [MSN][3].
218 | 
219 | [1]: http://google.com/        "Google"
220 | [2]: http://search.yahoo.com/  "Yahoo Search"
221 | [3]: http://search.msn.com/    "MSN Search"
222 | 
223 | 224 |

Output:

225 | 226 |
<p>I get 10 times more traffic from <a href="http://google.com/"
227 | title="Google">Google</a> than from <a href="http://search.yahoo.com/"
228 | title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
229 | title="MSN Search">MSN</a>.</p>
230 | 
231 | 232 |

The title attribute is optional. Link names may contain letters, 233 | numbers and spaces, but are not case sensitive:

234 | 235 |
I start my morning with a cup of coffee and
236 | [The New York Times][NY Times].
237 | 
238 | [ny times]: http://www.nytimes.com/
239 | 
240 | 241 |

Output:

242 | 243 |
<p>I start my morning with a cup of coffee and
244 | <a href="http://www.nytimes.com/">The New York Times</a>.</p>
245 | 
246 | 247 |

Images

248 | 249 |

Image syntax is very much like link syntax.

250 | 251 |

Inline (titles are optional):

252 | 253 |
![alt text](/path/to/img.jpg "Title")
254 | 
255 | 256 |

Reference-style:

257 | 258 |
![alt text][id]
259 | 
260 | [id]: /path/to/img.jpg "Title"
261 | 
262 | 263 |

Both of the above examples produce the same output:

264 | 265 |
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
266 | 
267 | 268 |

Code

269 | 270 |

In a regular paragraph, you can create code span by wrapping text in 271 | backtick quotes. Any ampersands (&) and angle brackets (< or 272 | >) will automatically be translated into HTML entities. This makes 273 | it easy to use Markdown to write about HTML example code:

274 | 275 |
I strongly recommend against using any `<blink>` tags.
276 | 
277 | I wish SmartyPants used named entities like `&mdash;`
278 | instead of decimal-encoded entites like `&#8212;`.
279 | 
280 | 281 |

Output:

282 | 283 |
<p>I strongly recommend against using any
284 | <code>&lt;blink&gt;</code> tags.</p>
285 | 
286 | <p>I wish SmartyPants used named entities like
287 | <code>&amp;mdash;</code> instead of decimal-encoded
288 | entites like <code>&amp;#8212;</code>.</p>
289 | 
290 | 291 |

To specify an entire block of pre-formatted code, indent every line of 292 | the block by 4 spaces or 1 tab. Just like with code spans, &, <, 293 | and > characters will be escaped automatically.

294 | 295 |

Markdown:

296 | 297 |
If you want your page to validate under XHTML 1.0 Strict,
298 | you've got to put paragraph tags in your blockquotes:
299 | 
300 |     <blockquote>
301 |         <p>For example.</p>
302 |     </blockquote>
303 | 
304 | 305 |

Output:

306 | 307 |
<p>If you want your page to validate under XHTML 1.0 Strict,
308 | you've got to put paragraph tags in your blockquotes:</p>
309 | 
310 | <pre><code>&lt;blockquote&gt;
311 |     &lt;p&gt;For example.&lt;/p&gt;
312 | &lt;/blockquote&gt;
313 | </code></pre>
314 | 
315 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Nested blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Nested blockquotes.xhtml: -------------------------------------------------------------------------------- 1 |
2 |

foo

3 | 4 |
5 |

bar

6 |
7 | 8 |

foo

9 |
10 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Ordered and unordered lists.text: -------------------------------------------------------------------------------- 1 | ## Unordered 2 | 3 | Asterisks tight: 4 | 5 | * asterisk 1 6 | * asterisk 2 7 | * asterisk 3 8 | 9 | 10 | Asterisks loose: 11 | 12 | * asterisk 1 13 | 14 | * asterisk 2 15 | 16 | * asterisk 3 17 | 18 | * * * 19 | 20 | Pluses tight: 21 | 22 | + Plus 1 23 | + Plus 2 24 | + Plus 3 25 | 26 | 27 | Pluses loose: 28 | 29 | + Plus 1 30 | 31 | + Plus 2 32 | 33 | + Plus 3 34 | 35 | * * * 36 | 37 | 38 | Minuses tight: 39 | 40 | - Minus 1 41 | - Minus 2 42 | - Minus 3 43 | 44 | 45 | Minuses loose: 46 | 47 | - Minus 1 48 | 49 | - Minus 2 50 | 51 | - Minus 3 52 | 53 | 54 | ## Ordered 55 | 56 | Tight: 57 | 58 | 1. First 59 | 2. Second 60 | 3. Third 61 | 62 | and: 63 | 64 | 1. One 65 | 2. Two 66 | 3. Three 67 | 68 | 69 | Loose using tabs: 70 | 71 | 1. First 72 | 73 | 2. Second 74 | 75 | 3. Third 76 | 77 | and using spaces: 78 | 79 | 1. One 80 | 81 | 2. Two 82 | 83 | 3. Three 84 | 85 | Multiple paragraphs: 86 | 87 | 1. Item 1, graf one. 88 | 89 | Item 2. graf two. The quick brown fox jumped over the lazy dog's 90 | back. 91 | 92 | 2. Item 2. 93 | 94 | 3. Item 3. 95 | 96 | 97 | 98 | ## Nested 99 | 100 | * Tab 101 | * Tab 102 | * Tab 103 | 104 | Here's another: 105 | 106 | 1. First 107 | 2. Second: 108 | * Fee 109 | * Fie 110 | * Foe 111 | 3. Third 112 | 113 | Same thing but with paragraphs: 114 | 115 | 1. First 116 | 117 | 2. Second: 118 | * Fee 119 | * Fie 120 | * Foe 121 | 122 | 3. Third 123 | 124 | 125 | This was an error in Markdown 1.0.1: 126 | 127 | * this 128 | 129 | * sub 130 | 131 | that 132 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Ordered and unordered lists.xhtml: -------------------------------------------------------------------------------- 1 |

Unordered

2 | 3 |

Asterisks tight:

4 | 5 |
    6 |
  • asterisk 1
  • 7 |
  • asterisk 2
  • 8 |
  • asterisk 3
  • 9 |
10 | 11 |

Asterisks loose:

12 | 13 |
    14 |
  • asterisk 1

  • 15 |
  • asterisk 2

  • 16 |
  • asterisk 3

  • 17 |
18 | 19 |
20 | 21 |

Pluses tight:

22 | 23 |
    24 |
  • Plus 1
  • 25 |
  • Plus 2
  • 26 |
  • Plus 3
  • 27 |
28 | 29 |

Pluses loose:

30 | 31 |
    32 |
  • Plus 1

  • 33 |
  • Plus 2

  • 34 |
  • Plus 3

  • 35 |
36 | 37 |
38 | 39 |

Minuses tight:

40 | 41 |
    42 |
  • Minus 1
  • 43 |
  • Minus 2
  • 44 |
  • Minus 3
  • 45 |
46 | 47 |

Minuses loose:

48 | 49 |
    50 |
  • Minus 1

  • 51 |
  • Minus 2

  • 52 |
  • Minus 3

  • 53 |
54 | 55 |

Ordered

56 | 57 |

Tight:

58 | 59 |
    60 |
  1. First
  2. 61 |
  3. Second
  4. 62 |
  5. Third
  6. 63 |
64 | 65 |

and:

66 | 67 |
    68 |
  1. One
  2. 69 |
  3. Two
  4. 70 |
  5. Three
  6. 71 |
72 | 73 |

Loose using tabs:

74 | 75 |
    76 |
  1. First

  2. 77 |
  3. Second

  4. 78 |
  5. Third

  6. 79 |
80 | 81 |

and using spaces:

82 | 83 |
    84 |
  1. One

  2. 85 |
  3. Two

  4. 86 |
  5. Three

  6. 87 |
88 | 89 |

Multiple paragraphs:

90 | 91 |
    92 |
  1. Item 1, graf one.

    93 | 94 |

    Item 2. graf two. The quick brown fox jumped over the lazy dog's 95 | back.

  2. 96 |
  3. Item 2.

  4. 97 |
  5. Item 3.

  6. 98 |
99 | 100 |

Nested

101 | 102 |
    103 |
  • Tab 104 |
      105 |
    • Tab 106 |
        107 |
      • Tab
      • 108 |
    • 109 |
  • 110 |
111 | 112 |

Here's another:

113 | 114 |
    115 |
  1. First
  2. 116 |
  3. Second: 117 |
      118 |
    • Fee
    • 119 |
    • Fie
    • 120 |
    • Foe
    • 121 |
  4. 122 |
  5. Third
  6. 123 |
124 | 125 |

Same thing but with paragraphs:

126 | 127 |
    128 |
  1. First

  2. 129 |
  3. Second:

    130 | 131 |
      132 |
    • Fee
    • 133 |
    • Fie
    • 134 |
    • Foe
    • 135 |
  4. 136 |
  5. Third

  6. 137 |
138 | 139 | 140 |

This was an error in Markdown 1.0.1:

141 | 142 |
    143 |
  • this

    144 | 145 |
    • sub
    146 | 147 |

    that

  • 148 |
149 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Strong and em together.text: -------------------------------------------------------------------------------- 1 | ***This is strong and em.*** 2 | 3 | So is ***this*** word. 4 | 5 | ___This is strong and em.___ 6 | 7 | So is ___this___ word. 8 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Strong and em together.xhtml: -------------------------------------------------------------------------------- 1 |

This is strong and em.

2 | 3 |

So is this word.

4 | 5 |

This is strong and em.

6 | 7 |

So is this word.

8 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Tabs.text: -------------------------------------------------------------------------------- 1 | + this is a list item 2 | indented with tabs 3 | 4 | + this is a list item 5 | indented with spaces 6 | 7 | Code: 8 | 9 | this code block is indented by one tab 10 | 11 | And: 12 | 13 | this code block is indented by two tabs 14 | 15 | And: 16 | 17 | + this is an example list item 18 | indented with tabs 19 | 20 | + this is an example list item 21 | indented with spaces 22 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Tabs.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • this is a list item 3 | indented with tabs

  • 4 |
  • this is a list item 5 | indented with spaces

  • 6 |
7 | 8 |

Code:

9 | 10 |
this code block is indented by one tab
11 | 
12 | 13 |

And:

14 | 15 |
    this code block is indented by two tabs
16 | 
17 | 18 |

And:

19 | 20 |
+   this is an example list item
21 |     indented with tabs
22 | 
23 | +   this is an example list item
24 |     indented with spaces
25 | 
26 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /test/mdtest1.1/Markdown.mdtest/Tidyness.xhtml: -------------------------------------------------------------------------------- 1 |
2 |

A list within a blockquote:

3 |
    4 |
  • asterisk 1
  • 5 |
  • asterisk 2
  • 6 |
  • asterisk 3
  • 7 |
8 |
9 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Abbr.text: -------------------------------------------------------------------------------- 1 | Some text about HTML, SGML and HTML4. 2 | 3 | Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French). 4 | 5 | *[HTML4]: Hyper Text Markup Language version 4 6 | *[HTML]: Hyper Text Markup Language 7 | *[SGML]: Standard Generalized Markup Language 8 | *[U.S.A.]: United States of America 9 | *[É.U.] : États-Unis d'Amérique 10 | *[É.-U. d'A.] : États-Unis d'Amérique 11 | 12 | And here we have a CD, some CDs, and some other CD's. 13 | 14 | *[CD]: Compact Disk 15 | 16 | Let's transfert documents through TCP/IP, using TCP packets. 17 | 18 | *[IP]: Internet Protocol 19 | *[TCP]: Transmission Control Protocol 20 | 21 | --- 22 | 23 | Bienvenue sur [CMS](http://www.bidulecms.com "Bidule CMS"). 24 | 25 | *[CMS]: Content Management System 26 | 27 | --- 28 | 29 | ATCCE 30 | 31 | *[ATCCE]: Abbreviation "Testing" Correct 'Character' < Escapes > -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Abbr.xhtml: -------------------------------------------------------------------------------- 1 |

Some text about HTML, SGML and HTML4.

2 | 3 |

Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French).

4 | 5 |

And here we have a CD, some CDs, and some other CD's.

6 | 7 |

Let's transfert documents through TCP/IP, using TCP packets.

8 | 9 |
10 | 11 |

Bienvenue sur CMS.

12 | 13 |
14 | 15 |

ATCCE

16 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Definition Lists.text: -------------------------------------------------------------------------------- 1 | A simple definition list: 2 | 3 | Term 1 4 | : Definition 1 5 | 6 | Term 2 7 | : Definition 2 8 | 9 | With multiple terms: 10 | 11 | Term 1 12 | Term 2 13 | : Definition 1 14 | 15 | Term 3 16 | Term 4 17 | : Definition 2 18 | 19 | With multiple definitions: 20 | 21 | Term 1 22 | : Definition 1 23 | : Definition 2 24 | 25 | Term 2 26 | : Definition 3 27 | : Definition 4 28 | 29 | With multiple lines per definition: 30 | 31 | Term 1 32 | : Definition 1 line 1 ... 33 | Definition 1 line 2 34 | : Definition 2 line 1 ... 35 | Definition 2 line 2 36 | 37 | Term 2 38 | : Definition 3 line 2 ... 39 | Definition 3 line 2 40 | : Definition 4 line 2 ... 41 | Definition 4 line 2 42 | 43 | With paragraphs: 44 | 45 | Term 1 46 | 47 | : Definition 1 (paragraph) 48 | 49 | Term 2 50 | 51 | : Definition 2 (paragraph) 52 | 53 | With multiple paragraphs: 54 | 55 | Term 1 56 | 57 | : Definition 1 paragraph 1 line 1 ... 58 | Definition 1 paragraph 1 line 2 59 | 60 | Definition 1 paragraph 2 line 1 ... 61 | Definition 1 paragraph 2 line 2 62 | 63 | Term 2 64 | 65 | : Definition 1 paragraph 1 line 1 ... 66 | Definition 1 paragraph 1 line 2 (lazy) 67 | 68 | Definition 1 paragraph 2 line 1 ... 69 | Definition 1 paragraph 2 line 2 (lazy) 70 | 71 | * * * 72 | 73 | A mix: 74 | 75 | Term 1 76 | Term 2 77 | 78 | : Definition 1 paragraph 1 line 1 ... 79 | Definition 1 paragraph 1 line 2 (lazy) 80 | 81 | Definition 1 paragraph 2 line 1 ... 82 | Definition 1 paragraph 2 line 2 83 | 84 | : Definition 2 paragraph 1 line 1 ... 85 | Definition 2 paragraph 1 line 2 (lazy) 86 | 87 | Term 3 88 | : Definition 3 (no paragraph) 89 | : Definition 4 (no paragraph) 90 | : Definition 5 line 1 ... 91 | Definition 5 line 2 (no paragraph) 92 | 93 | : Definition 6 paragraph 1 line 1 ... 94 | Definition 6 paragraph 1 line 2 95 | : Definition 7 (no paragraph) 96 | : Definition 8 paragraph 1 line 1 (forced paragraph) ... 97 | Definition 8 paragraph 1 line 2 98 | 99 | Definition 8 paragraph 2 line 1 100 | 101 | Term 4 102 | : Definition 9 paragraph 1 line 1 (forced paragraph) ... 103 | Definition 9 paragraph 1 line 2 104 | 105 | Definition 9 paragraph 2 line 1 106 | : Definition 10 (no paragraph) 107 | 108 | * * * 109 | 110 | Special cases: 111 | 112 | Term 113 | 114 | : code block 115 | as first element of a definition -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Definition Lists.xhtml: -------------------------------------------------------------------------------- 1 |

A simple definition list:

2 | 3 |
4 |
Term 1
5 |
Definition 1
6 | 7 |
Term 2
8 |
Definition 2
9 |
10 | 11 |

With multiple terms:

12 | 13 |
14 |
Term 1
15 |
Term 2
16 |
Definition 1
17 | 18 |
Term 3
19 |
Term 4
20 |
Definition 2
21 |
22 | 23 |

With multiple definitions:

24 | 25 |
26 |
Term 1
27 |
Definition 1
28 | 29 |
Definition 2
30 | 31 |
Term 2
32 |
Definition 3
33 | 34 |
Definition 4
35 |
36 | 37 |

With multiple lines per definition:

38 | 39 |
40 |
Term 1
41 |
Definition 1 line 1 ... 42 | Definition 1 line 2
43 | 44 |
Definition 2 line 1 ... 45 | Definition 2 line 2
46 | 47 |
Term 2
48 |
Definition 3 line 2 ... 49 | Definition 3 line 2
50 | 51 |
Definition 4 line 2 ... 52 | Definition 4 line 2
53 |
54 | 55 |

With paragraphs:

56 | 57 |
58 |
Term 1
59 |
60 |

Definition 1 (paragraph)

61 |
62 | 63 |
Term 2
64 |
65 |

Definition 2 (paragraph)

66 |
67 |
68 | 69 |

With multiple paragraphs:

70 | 71 |
72 |
Term 1
73 |
74 |

Definition 1 paragraph 1 line 1 ... 75 | Definition 1 paragraph 1 line 2

76 | 77 |

Definition 1 paragraph 2 line 1 ... 78 | Definition 1 paragraph 2 line 2

79 |
80 | 81 |
Term 2
82 |
83 |

Definition 1 paragraph 1 line 1 ... 84 | Definition 1 paragraph 1 line 2 (lazy)

85 | 86 |

Definition 1 paragraph 2 line 1 ... 87 | Definition 1 paragraph 2 line 2 (lazy)

88 |
89 |
90 | 91 |
92 | 93 |

A mix:

94 | 95 |
96 |
Term 1
97 |
Term 2
98 |
99 |

Definition 1 paragraph 1 line 1 ... 100 | Definition 1 paragraph 1 line 2 (lazy)

101 | 102 |

Definition 1 paragraph 2 line 1 ... 103 | Definition 1 paragraph 2 line 2

104 |
105 | 106 |
107 |

Definition 2 paragraph 1 line 1 ... 108 | Definition 2 paragraph 1 line 2 (lazy)

109 |
110 | 111 |
Term 3
112 |
Definition 3 (no paragraph)
113 | 114 |
Definition 4 (no paragraph)
115 | 116 |
Definition 5 line 1 ... 117 | Definition 5 line 2 (no paragraph)
118 | 119 |
120 |

Definition 6 paragraph 1 line 1 ... 121 | Definition 6 paragraph 1 line 2

122 |
123 | 124 |
Definition 7 (no paragraph)
125 | 126 |
127 |

Definition 8 paragraph 1 line 1 (forced paragraph) ... 128 | Definition 8 paragraph 1 line 2

129 | 130 |

Definition 8 paragraph 2 line 1

131 |
132 | 133 |
Term 4
134 |
135 |

Definition 9 paragraph 1 line 1 (forced paragraph) ... 136 | Definition 9 paragraph 1 line 2

137 | 138 |

Definition 9 paragraph 2 line 1

139 |
140 | 141 |
Definition 10 (no paragraph)
142 |
143 | 144 |
145 | 146 |

Special cases:

147 | 148 |
149 |
Term
150 |
151 |
code block
152 | as first element of a definition
153 | 
154 |
155 |
156 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Emphasis.text: -------------------------------------------------------------------------------- 1 | Combined emphasis: 2 | 3 | 1. ***test test*** 4 | 2. ___test test___ 5 | 3. *test **test*** 6 | 4. **test *test*** 7 | 5. ***test* test** 8 | 6. ***test** test* 9 | 7. ***test* test** 10 | 8. **test *test*** 11 | 9. *test **test*** 12 | 10. _test __test___ 13 | 11. __test _test___ 14 | 12. ___test_ test__ 15 | 13. ___test__ test_ 16 | 14. ___test_ test__ 17 | 15. __test _test___ 18 | 16. _test __test___ 19 | 20 | 21 | Incorrect nesting: 22 | 23 | 1. *test **test* test** 24 | 2. _test __test_ test__ 25 | 3. **test *test** test* 26 | 4. __test _test__ test_ 27 | 5. *test *test* test* 28 | 6. _test _test_ test_ 29 | 7. **test **test** test** 30 | 8. __test __test__ test__ 31 | 32 | 33 | 34 | No emphasis: 35 | 36 | 1. test* test *test 37 | 2. test** test **test 38 | 3. test_ test _test 39 | 4. test__ test __test 40 | 41 | 42 | 43 | Middle-word emphasis (asterisks): 44 | 45 | 1. *a*b 46 | 2. a*b* 47 | 3. a*b*c 48 | 4. **a**b 49 | 5. a**b** 50 | 6. a**b**c 51 | 52 | 53 | Middle-word emphasis (underscore): 54 | 55 | 1. _a_b 56 | 2. a_b_ 57 | 3. a_b_c 58 | 4. __a__b 59 | 5. a__b__ 60 | 6. a__b__c 61 | 62 | my_precious_file.txt 63 | 64 | 65 | ## Tricky Cases 66 | 67 | E**. **Test** TestTestTest 68 | 69 | E**. **Test** Test Test Test 70 | 71 | 72 | ## Overlong emphasis 73 | 74 | Name: ____________ 75 | Organization: ____ 76 | Region/Country: __ 77 | 78 | _____Cut here_____ 79 | 80 | ____Cut here____ 81 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Emphasis.xhtml: -------------------------------------------------------------------------------- 1 |

Combined emphasis:

2 | 3 |
    4 |
  1. test test
  2. 5 |
  3. test test
  4. 6 |
  5. test test
  6. 7 |
  7. test test
  8. 8 |
  9. test test
  10. 9 |
  11. test test
  12. 10 |
  13. test test
  14. 11 |
  15. test test
  16. 12 |
  17. test test
  18. 13 |
  19. test test
  20. 14 |
  21. test test
  22. 15 |
  23. test test
  24. 16 |
  25. test test
  26. 17 |
  27. test test
  28. 18 |
  29. test test
  30. 19 |
  31. test test
  32. 20 |
21 | 22 |

Incorrect nesting:

23 | 24 |
    25 |
  1. *test test* test
  2. 26 |
  3. _test test_ test
  4. 27 |
  5. test *test test*
  6. 28 |
  7. test _test test_
  8. 29 |
  9. test *test test*
  10. 30 |
  11. test _test test_
  12. 31 |
  13. test **test test**
  14. 32 |
  15. test __test test__
  16. 33 |
34 | 35 |

No emphasis:

36 | 37 |
    38 |
  1. test* test *test
  2. 39 |
  3. test** test **test
  4. 40 |
  5. test_ test _test
  6. 41 |
  7. test__ test __test
  8. 42 |
43 | 44 |

Middle-word emphasis (asterisks):

45 | 46 |
    47 |
  1. ab
  2. 48 |
  3. ab
  4. 49 |
  5. abc
  6. 50 |
  7. ab
  8. 51 |
  9. ab
  10. 52 |
  11. abc
  12. 53 |
54 | 55 |

Middle-word emphasis (underscore):

56 | 57 |
    58 |
  1. _a_b
  2. 59 |
  3. a_b_
  4. 60 |
  5. a_b_c
  6. 61 |
  7. __a__b
  8. 62 |
  9. a__b__
  10. 63 |
  11. a__b__c
  12. 64 |
65 | 66 |

my_precious_file.txt

67 | 68 |

Tricky Cases

69 | 70 |

E**. Test TestTestTest

71 | 72 |

E**. Test Test Test Test

73 | 74 | 75 |

Overlong emphasis

76 | 77 |

Name: ____________
78 | Organization: ____
79 | Region/Country: __

80 | 81 |

_____Cut here_____

82 | 83 |

____Cut here____

84 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Fenced Code Blocks.text: -------------------------------------------------------------------------------- 1 | ~~~ 2 | Fenced 3 | ~~~ 4 | 5 | Code block starting and ending with empty lines: 6 | ~~~ 7 | 8 | 9 | Fenced 10 | 11 | 12 | ~~~ 13 | 14 | Indented code block containing fenced code block sample: 15 | 16 | ~~~ 17 | Fenced 18 | ~~~ 19 | 20 | Fenced code block with indented code block sample: 21 | 22 | ~~~ 23 | Some text 24 | 25 | Indented code block sample code 26 | ~~~ 27 | 28 | Fenced code block with long markers: 29 | 30 | ~~~~~~~~~~~~~~~~~~ 31 | Fenced 32 | ~~~~~~~~~~~~~~~~~~ 33 | 34 | Fenced code block with fenced code block markers of different length in it: 35 | 36 | ~~~~ 37 | In code block 38 | ~~~ 39 | Still in code block 40 | ~~~~~ 41 | Still in code block 42 | ~~~~ 43 | 44 | Fenced code block with Markdown header and horizontal rule: 45 | 46 | ~~~ 47 | #test 48 | --- 49 | ~~~ 50 | 51 | Fenced code block with link definitions, footnote definition and 52 | abbreviation definitions: 53 | 54 | ~~~ 55 | [example]: http://example.com/ 56 | 57 | [^1]: Footnote def 58 | 59 | *[HTML]: HyperText Markup Language 60 | ~~~ -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Fenced Code Blocks.xhtml: -------------------------------------------------------------------------------- 1 |
Fenced
 2 | 
3 | 4 |

Code block starting and ending with empty lines:

5 | 6 |


Fenced 7 | 8 | 9 |
10 | 11 |

Indented code block containing fenced code block sample:

12 | 13 |
~~~
14 | Fenced
15 | ~~~
16 | 
17 | 18 |

Fenced code block with indented code block sample:

19 | 20 |
Some text
21 | 
22 |     Indented code block sample code
23 | 
24 | 25 |

Fenced code block with long markers:

26 | 27 |
Fenced
28 | 
29 | 30 |

Fenced code block with fenced code block markers of different length in it:

31 | 32 |
In code block
33 | ~~~
34 | Still in code block
35 | ~~~~~
36 | Still in code block
37 | 
38 | 39 |

Fenced code block with Markdown header and horizontal rule:

40 | 41 |
#test
42 | ---
43 | 
44 | 45 |

Fenced code block with link definitions, footnote definition and 46 | abbreviation definitions:

47 | 48 |
[example]: http://example.com/
49 | 
50 | [^1]: Footnote def
51 | 
52 | *[HTML]: HyperText Markup Language
53 | 
54 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Footnotes.text: -------------------------------------------------------------------------------- 1 | This is the first paragraph.[^first] 2 | 3 | [^first]: This is the first note. 4 | 5 | * List item one.[^second] 6 | * List item two.[^third] 7 | 8 | [^third]: This is the third note, defined out of order. 9 | [^second]: This is the second note. 10 | [^fourth]: This is the fourth note. 11 | 12 | # Header[^fourth] 13 | 14 | Some paragraph with a footnote[^1], and another[^2]. 15 | 16 | [^1]: Content for fifth footnote. 17 | [^2]: Content for sixth footnote spaning on 18 | three lines, with some span-level markup like 19 | _emphasis_, a [link][]. 20 | 21 | [link]: http://www.michelf.com/ 22 | 23 | Another paragraph with a named footnote[^fn-name]. 24 | 25 | [^fn-name]: 26 | Footnote beginning on the line next to the marker. 27 | 28 | This paragraph should not have a footnote marker since 29 | the footnote is undefined.[^3] 30 | 31 | This paragraph should not have a footnote marker since 32 | the footnote has already been used before.[^1] 33 | 34 | This paragraph links to a footnote with plenty of 35 | block-level content.[^block] 36 | 37 | [^block]: 38 | Paragraph. 39 | 40 | * List item 41 | 42 | > Blockquote 43 | 44 | Code block 45 | 46 | This paragraph host the footnote reference within a 47 | footnote test[^reference]. 48 | 49 | [^reference]: 50 | This footnote has a footnote of its own.[^nested] 51 | 52 | [^nested]: 53 | This footnote should appear even though as it is refered 54 | from another footnote. But [^reference] should be litteral 55 | since the footnote with that name has already been used. 56 | 57 | - - - 58 | 59 | Testing unusual footnote name[^1$^!"']. 60 | 61 | [^1$^!"']: Haha! 62 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Footnotes.xhtml: -------------------------------------------------------------------------------- 1 |

This is the first paragraph.1

2 | 3 |
    4 |
  • List item one.2
  • 5 |
  • List item two.3
  • 6 |
7 | 8 |

Header4

9 | 10 |

Some paragraph with a footnote5, and another6.

11 | 12 |

Another paragraph with a named footnote7.

13 | 14 |

This paragraph should not have a footnote marker since 15 | the footnote is undefined.[^3]

16 | 17 |

This paragraph should not have a footnote marker since 18 | the footnote has already been used before.[^1]

19 | 20 |

This paragraph links to a footnote with plenty of 21 | block-level content.8

22 | 23 |

This paragraph host the footnote reference within a 24 | footnote test9.

25 | 26 |
27 | 28 |

Testing unusual footnote name10.

29 | 30 |
31 |
32 |
    33 | 34 |
  1. 35 |

    This is the first note. 

    36 |
  2. 37 | 38 |
  3. 39 |

    This is the second note. 

    40 |
  4. 41 | 42 |
  5. 43 |

    This is the third note, defined out of order. 

    44 |
  6. 45 | 46 |
  7. 47 |

    This is the fourth note. 

    48 |
  8. 49 | 50 |
  9. 51 |

    Content for fifth footnote. 

    52 |
  10. 53 | 54 |
  11. 55 |

    Content for sixth footnote spaning on 56 | three lines, with some span-level markup like 57 | emphasis, a link

    58 |
  12. 59 | 60 |
  13. 61 |

    Footnote beginning on the line next to the marker. 

    62 |
  14. 63 | 64 |
  15. 65 |

    Paragraph.

    66 | 67 |
      68 |
    • List item
    • 69 |
    70 | 71 |
    72 |

    Blockquote

    73 |
    74 | 75 |
    Code block
    76 | 
    77 | 78 |

    79 |
  16. 80 | 81 |
  17. 82 |

    This footnote has a footnote of its own.11 

    83 |
  18. 84 | 85 |
  19. 86 |

    Haha! 

    87 |
  20. 88 | 89 |
  21. 90 |

    This footnote should appear even though as it is refered 91 | from another footnote. But [^reference] should be litteral 92 | since the footnote with that name has already been used. 

    93 |
  22. 94 | 95 |
96 |
97 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Inline HTML with Markdown content.text: -------------------------------------------------------------------------------- 1 | # Markdown inside code blocks 2 | 3 |
4 | foo 5 |
6 | 7 |
8 | foo 9 |
10 | 11 |
12 | foo 13 |
14 | 15 | 16 | 17 |
test _emphasis_ (span)
18 | 19 | 20 | 21 |
test _emphasis_ (span)
22 | 23 | 24 | 25 |
test _emphasis_ (block)
26 | 27 | ## More complicated 28 | 29 | 30 | 32 | 34 | 37 |
31 | * this is _not_ a list item
33 | * this is _not_ a list item
35 | * this _is_ a list item 36 |
38 | 39 | ## With indent 40 | 41 |
42 |
43 | This text is no code block: if it was, the 44 | closing `
` would be too and the HTML block 45 | would be invalid. 46 | 47 | Markdown content in HTML blocks is assumed to be 48 | indented the same as the block opening tag. 49 | 50 | **This should be the third paragraph after the header.** 51 |
52 |
53 | 54 | ## Code block with rogue `
`s in Markdown code span and block 55 | 56 |
57 |
58 | 59 | This is a code block however: 60 | 61 |
62 | 63 | Funny isn't it? Here is a code span: `
`. 64 | 65 |
66 |
67 | 68 |
69 |
70 | * List item, not a code block 71 | 72 | Some text 73 | 74 | This is a code block. 75 |
76 |
77 | 78 | ## No code block in markdown span mode 79 | 80 |

81 | This is not a code block since Markdown parse paragraph 82 | content as span. Code spans like `

` are allowed though. 83 |

84 | 85 |

_Hello_ _world_

86 | 87 | ## Preserving attributes and tags on more than one line: 88 | 89 |

91 | Some _span_ content. 92 |

93 | 94 | 95 | ## Header confusion bug 96 | 97 | 98 | 99 | 103 | 104 |
Hello World! 100 | ============ 101 | 102 | Hello World!
105 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Inline HTML with Markdown content.xhtml: -------------------------------------------------------------------------------- 1 |

Markdown inside code blocks

2 | 3 |
4 | 5 |

foo

6 | 7 |
8 | 9 |
10 | 11 |

foo

12 | 13 |
14 | 15 |
16 | 17 |

foo

18 | 19 |
20 | 21 | 22 | 23 |
test emphasis (span)
24 | 25 | 26 | 27 |
test emphasis (span)
28 | 29 | 30 | 35 |
31 | 32 |

test emphasis (block)

33 | 34 |
36 | 37 |

More complicated

38 | 39 | 40 | 42 | 44 | 51 |
41 | * this is not a list item
43 | * this is not a list item
45 | 46 |
    47 |
  • this is a list item
  • 48 |
49 | 50 |
52 | 53 |

With indent

54 | 55 |
56 |
57 | 58 |

This text is no code block: if it was, the 59 | closing <div> would be too and the HTML block 60 | would be invalid.

61 | 62 |

Markdown content in HTML blocks is assumed to be 63 | indented the same as the block opening tag.

64 | 65 |

This should be the third paragraph after the header.

66 | 67 |
68 |
69 | 70 |

Code block with rogue </div>s in Markdown code span and block

71 | 72 |
73 |
74 | 75 |

This is a code block however:

76 | 77 |
</div>
 78 | 
79 | 80 |

Funny isn't it? Here is a code span: </div>.

81 | 82 |
83 |
84 | 85 |
86 |
87 | 88 |
    89 |
  • List item, not a code block
  • 90 |
91 | 92 |

Some text

93 | 94 |
This is a code block.
 95 | 
96 | 97 |
98 |
99 | 100 |

No code block in markdown span mode

101 | 102 |

103 | This is not a code block since Markdown parse paragraph 104 | content as span. Code spans like </p> are allowed though. 105 |

106 | 107 |

Hello world

108 | 109 |

Preserving attributes and tags on more than one line:

110 | 111 |

113 | Some span content. 114 |

115 | 116 |

Header confusion bug

117 | 118 | 119 | 120 | 124 | 125 |
Hello World! 121 | ============ 122 | 123 | Hello World!
-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Tables.text: -------------------------------------------------------------------------------- 1 | # Simple tables 2 | 3 | Header 1 | Header 2 4 | --------- | --------- 5 | Cell 1 | Cell 2 6 | Cell 3 | Cell 4 7 | 8 | With leading pipes: 9 | 10 | | Header 1 | Header 2 11 | | --------- | --------- 12 | | Cell 1 | Cell 2 13 | | Cell 3 | Cell 4 14 | 15 | With tailing pipes: 16 | 17 | Header 1 | Header 2 | 18 | --------- | --------- | 19 | Cell 1 | Cell 2 | 20 | Cell 3 | Cell 4 | 21 | 22 | With leading and tailing pipes: 23 | 24 | | Header 1 | Header 2 | 25 | | --------- | --------- | 26 | | Cell 1 | Cell 2 | 27 | | Cell 3 | Cell 4 | 28 | 29 | * * * 30 | 31 | # One-column one-row table 32 | 33 | With leading pipes: 34 | 35 | | Header 36 | | ------- 37 | | Cell 38 | 39 | With tailing pipes: 40 | 41 | Header | 42 | ------- | 43 | Cell | 44 | 45 | With leading and tailing pipes: 46 | 47 | | Header | 48 | | ------- | 49 | | Cell | 50 | 51 | * * * 52 | 53 | Table alignement: 54 | 55 | | Default | Right | Center | Left | 56 | | --------- |:--------- |:---------:| ---------:| 57 | | Long Cell | Long Cell | Long Cell | Long Cell | 58 | | Cell | Cell | Cell | Cell | 59 | 60 | Table alignement (alternate spacing): 61 | 62 | | Default | Right | Center | Left | 63 | | --------- | :-------- | :-------: | --------: | 64 | | Long Cell | Long Cell | Long Cell | Long Cell | 65 | | Cell | Cell | Cell | Cell | 66 | 67 | * * * 68 | 69 | # Empty cells 70 | 71 | | Header 1 | Header 2 | 72 | | --------- | --------- | 73 | | A | B | 74 | | C | | 75 | 76 | Header 1 | Header 2 77 | --------- | --------- 78 | A | B 79 | | D 80 | 81 | * * * 82 | 83 | # Missing tailing pipe 84 | 85 | Header 1 | Header 2 86 | --------- | --------- | 87 | Cell | Cell | 88 | Cell | Cell | 89 | 90 | Header 1 | Header 2 | 91 | --------- | --------- 92 | Cell | Cell | 93 | Cell | Cell | 94 | 95 | Header 1 | Header 2 | 96 | --------- | --------- | 97 | Cell | Cell 98 | Cell | Cell | 99 | 100 | Header 1 | Header 2 | 101 | --------- | --------- | 102 | Cell | Cell | 103 | Cell | Cell 104 | 105 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown Extra.mdtest/Tables.xhtml: -------------------------------------------------------------------------------- 1 |

Simple tables

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
21 | 22 |

With leading pipes:

23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
42 | 43 |

With tailing pipes:

44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
63 | 64 |

With leading and tailing pipes:

65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
84 | 85 |
86 | 87 |

One-column one-row table

88 | 89 |

With leading pipes:

90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 |
Header
Cell
103 | 104 |

With tailing pipes:

105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 |
Header
Cell
118 | 119 |

With leading and tailing pipes:

120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 |
Header
Cell
133 | 134 |
135 | 136 |

Table alignement:

137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 |
DefaultRightCenterLeft
Long CellLong CellLong CellLong Cell
CellCellCellCell
162 | 163 |

Table alignement (alternate spacing):

164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 |
DefaultRightCenterLeft
Long CellLong CellLong CellLong Cell
CellCellCellCell
189 | 190 |
191 | 192 |

Empty cells

193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 |
Header 1Header 2
AB
C
212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 |
Header 1Header 2
AB
D
231 | 232 |
233 | 234 |

Missing tailing pipe

235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 |
Header 1Header 2
CellCell
CellCell
254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 |
Header 1Header 2
CellCell
CellCell
273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 |
Header 1Header 2
CellCell
CellCell
292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 |
Header 1Header 2
CellCell
CellCell
-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Auto Links.text: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Auto Links.xhtml: -------------------------------------------------------------------------------- 1 |

HTTP://WWW.SOMEURL.COM

2 | 3 |

hr@company.com

-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Backslash escapes.text: -------------------------------------------------------------------------------- 1 | Tricky combinaisons: backslash with \\-- two dashes backslash with \\> greater than \\\[test](not a link) \\\*no emphasis* -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Backslash escapes.xhtml: -------------------------------------------------------------------------------- 1 |

Tricky combinaisons:

backslash with \-- two dashes

backslash with \> greater than

\[test](not a link)

\*no emphasis*

-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Code Spans.text: -------------------------------------------------------------------------------- 1 | From `` 2 | on two lines. 3 | 4 | From `` 6 | on three lines. 7 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Code Spans.xhtml: -------------------------------------------------------------------------------- 1 |

From <!-- to --> 2 | on two lines.

3 | 4 |

From <!-- 5 | to --> 6 | on three lines.

7 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Code block in a list item.text: -------------------------------------------------------------------------------- 1 | 2 | * List Item: 3 | 4 | code block 5 | 6 | with a blank line 7 | 8 | within a list item. 9 | 10 | * code block 11 | as first element of a list item 12 | 13 | * List Item: 14 | 15 | code block with whitespace on preceding line -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Code block in a list item.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • List Item:

    3 | 4 |
    code block
     5 | 
     6 | with a blank line
     7 | 
    8 | 9 |

    within a list item.

  • 10 |
  • code block
    11 | as first element of a list item
    12 | 
  • 13 | 14 |
  • List Item:

    15 | 16 |
    code block with whitespace on preceding line
    17 | 
  • 18 |
-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Code block on second line.text: -------------------------------------------------------------------------------- 1 | 2 | Codeblock on second line 3 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Code block on second line.xhtml: -------------------------------------------------------------------------------- 1 |
Codeblock on second line
2 | 
3 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Email auto links.text: -------------------------------------------------------------------------------- 1 | 2 | 3 | International domain names: -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Email auto links.xhtml: -------------------------------------------------------------------------------- 1 |

michel.fortin@michelf.com

2 | 3 |

International domain names: help@tūdaliņ.lv

4 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Emphasis.text: -------------------------------------------------------------------------------- 1 | Combined emphasis: 2 | 3 | 1. ***test test*** 4 | 2. ___test test___ 5 | 3. *test **test*** 6 | 4. **test *test*** 7 | 5. ***test* test** 8 | 6. ***test** test* 9 | 7. ***test* test** 10 | 8. **test *test*** 11 | 9. *test **test*** 12 | 10. _test __test___ 13 | 11. __test _test___ 14 | 12. ___test_ test__ 15 | 13. ___test__ test_ 16 | 14. ___test_ test__ 17 | 15. __test _test___ 18 | 16. _test __test___ 19 | 20 | 21 | Incorrect nesting: 22 | 23 | 1. *test **test* test** 24 | 2. _test __test_ test__ 25 | 3. **test *test** test* 26 | 4. __test _test__ test_ 27 | 5. *test *test* test* 28 | 6. _test _test_ test_ 29 | 7. **test **test** test** 30 | 8. __test __test__ test__ 31 | 32 | 33 | 34 | No emphasis: 35 | 36 | 1. test* test *test 37 | 2. test** test **test 38 | 3. test_ test _test 39 | 4. test__ test __test 40 | 41 | 42 | 43 | Middle-word emphasis (asterisks): 44 | 45 | 1. *a*b 46 | 2. a*b* 47 | 3. a*b*c 48 | 4. **a**b 49 | 5. a**b** 50 | 6. a**b**c 51 | 52 | 53 | Middle-word emphasis (underscore): 54 | 55 | 1. _a_b 56 | 2. a_b_ 57 | 3. a_b_c 58 | 4. __a__b 59 | 5. a__b__ 60 | 6. a__b__c 61 | 62 | my_precious_file.txt 63 | 64 | 65 | ## Tricky Cases 66 | 67 | E**. **Test** TestTestTest 68 | 69 | E**. **Test** Test Test Test 70 | 71 | 72 | ## Overlong emphasis 73 | 74 | Name: ____________ 75 | Organization: ____ 76 | Region/Country: __ 77 | 78 | _____Cut here_____ 79 | 80 | ____Cut here____ 81 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Emphasis.xhtml: -------------------------------------------------------------------------------- 1 |

Combined emphasis:

2 | 3 |
    4 |
  1. test test
  2. 5 |
  3. test test
  4. 6 |
  5. test test
  6. 7 |
  7. test test
  8. 8 |
  9. test test
  10. 9 |
  11. test test
  12. 10 |
  13. test test
  14. 11 |
  15. test test
  16. 12 |
  17. test test
  18. 13 |
  19. test test
  20. 14 |
  21. test test
  22. 15 |
  23. test test
  24. 16 |
  25. test test
  26. 17 |
  27. test test
  28. 18 |
  29. test test
  30. 19 |
  31. test test
  32. 20 |
21 | 22 |

Incorrect nesting:

23 | 24 |
    25 |
  1. *test test* test
  2. 26 |
  3. _test test_ test
  4. 27 |
  5. test *test test*
  6. 28 |
  7. test _test test_
  8. 29 |
  9. test *test test*
  10. 30 |
  11. test _test test_
  12. 31 |
  13. test **test test**
  14. 32 |
  15. test __test test__
  16. 33 |
34 | 35 |

No emphasis:

36 | 37 |
    38 |
  1. test* test *test
  2. 39 |
  3. test** test **test
  4. 40 |
  5. test_ test _test
  6. 41 |
  7. test__ test __test
  8. 42 |
43 | 44 |

Middle-word emphasis (asterisks):

45 | 46 |
    47 |
  1. ab
  2. 48 |
  3. ab
  4. 49 |
  5. abc
  6. 50 |
  7. ab
  8. 51 |
  9. ab
  10. 52 |
  11. abc
  12. 53 |
54 | 55 |

Middle-word emphasis (underscore):

56 | 57 |
    58 |
  1. ab
  2. 59 |
  3. ab
  4. 60 |
  5. abc
  6. 61 |
  7. ab
  8. 62 |
  9. ab
  10. 63 |
  11. abc
  12. 64 |
65 | 66 |

mypreciousfile.txt

67 | 68 |

Tricky Cases

69 | 70 |

E**. Test TestTestTest

71 | 72 |

E**. Test Test Test Test

73 | 74 | 75 |

Overlong emphasis

76 | 77 |

Name: ____________
78 | Organization: ____
79 | Region/Country: __

80 | 81 |

_____Cut here_____

82 | 83 |

____Cut here____

-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Empty List Item.text: -------------------------------------------------------------------------------- 1 | With asterisks 2 | 3 | * List item 4 | * 5 | * List item 6 | 7 | With numbers 8 | 9 | 1. List item 10 | 2. 11 | 3. List item 12 | 13 | With hyphens 14 | 15 | - List item 16 | - 17 | - List item 18 | 19 | With asterisks 20 | 21 | * List item 22 | * List item 23 | * 24 | 25 | With numbers 26 | 27 | 1. List item 28 | 2. List item 29 | 3. 30 | 31 | With hyphens 32 | 33 | - List item 34 | - List item 35 | - 36 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Empty List Item.xhtml: -------------------------------------------------------------------------------- 1 |

With asterisks

2 | 3 |
    4 |
  • List item
  • 5 |
  • 6 |
  • List item
  • 7 |
8 | 9 |

With numbers

10 | 11 |
    12 |
  1. List item
  2. 13 |
  3. 14 |
  4. List item
  5. 15 |
16 | 17 |

With hyphens

18 | 19 |
    20 |
  • List item
  • 21 |
  • 22 |
  • List item
  • 23 |
24 | 25 |

With asterisks

26 | 27 |
    28 |
  • List item
  • 29 |
  • List item
  • 30 |
  • 31 |
32 | 33 |

With numbers

34 | 35 |
    36 |
  1. List item
  2. 37 |
  3. List item
  4. 38 |
  5. 39 |
40 | 41 |

With hyphens

42 | 43 |
    44 |
  • List item
  • 45 |
  • List item
  • 46 |
  • 47 |
-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Headers.text: -------------------------------------------------------------------------------- 1 | Header ====== Header ------ ### Header 2 | 3 | - - - 4 | 5 | Header ====== Paragraph Header ------ Paragraph ### Header Paragraph 6 | 7 | - - - 8 | 9 | Paragraph Header ====== Paragraph Paragraph Header ------ Paragraph Paragraph ### Header Paragraph -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Headers.xhtml: -------------------------------------------------------------------------------- 1 |

Header

2 | 3 |

Header

4 | 5 |

Header

6 | 7 |
8 | 9 |

Header

10 | 11 |

Paragraph

12 | 13 |

Header

14 | 15 |

Paragraph

16 | 17 |

Header

18 | 19 |

Paragraph

20 | 21 |
22 | 23 |

Paragraph

24 | 25 |

Header

26 | 27 |

Paragraph

28 | 29 |

Paragraph

30 | 31 |

Header

32 | 33 |

Paragraph

34 | 35 |

Paragraph

36 | 37 |

Header

38 | 39 |

Paragraph

40 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Horizontal Rules.text: -------------------------------------------------------------------------------- 1 | Horizontal rules: 2 | 3 | - - - 4 | 5 | * * * 6 | 7 | *** 8 | 9 | --- 10 | 11 | ___ 12 | 13 | Not horizontal rules (testing for a bug in 1.0.1j): 14 | 15 | +++ 16 | 17 | ,,, 18 | 19 | === 20 | 21 | ??? 22 | 23 | AAA 24 | 25 | jjj 26 | 27 | j j j 28 | 29 | n n n 30 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Horizontal Rules.xhtml: -------------------------------------------------------------------------------- 1 |

Horizontal rules:

2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
10 | 11 |
12 | 13 |

Not horizontal rules (testing for a bug in 1.0.1j):

14 | 15 |

+++

16 | 17 |

,,,

18 | 19 |

===

20 | 21 |

???

22 | 23 |

AAA

24 | 25 |

jjj

26 | 27 |

j j j

28 | 29 |

n n n

30 | 31 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Inline HTML (Simple).html: -------------------------------------------------------------------------------- 1 |

With some attributes:

2 | 3 |
4 | foo 5 |
6 | 7 |
9 | foo 10 |
11 | 12 |

Hr's:

13 | 14 |
-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Inline HTML (Simple).text: -------------------------------------------------------------------------------- 1 | With some attributes: 2 | 3 |
4 | foo 5 |
6 | 7 |
9 | foo 10 |
11 | 12 | Hr's: 13 | 14 |
16 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Inline HTML (Span).text: -------------------------------------------------------------------------------- 1 | ACINACS 2 | 3 | SB 4 | SB -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Inline HTML (Span).xhtml: -------------------------------------------------------------------------------- 1 |

ACINACS

2 | 3 |

SB 4 | SB

-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Inline HTML comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

2 | 3 | 4 | 5 |

Paragraph two.

6 | 7 | 8 | 9 |

The end.

10 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Inline HTML comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | Paragraph two. 6 | 7 | 8 | 9 | The end. 10 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Ins & del.text: -------------------------------------------------------------------------------- 1 | Here is a block tag ins: 2 | 3 | 4 |

Some text

5 |
6 | 7 | And here it is inside a paragraph. 8 | 9 | And here it is in the middle of a paragraph. 10 | 11 | 12 |

Some text

13 |
14 | 15 | And here is ins as a paragraph. 16 | 17 | And here it is in the middle of a paragraph. 18 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Ins & del.xhtml: -------------------------------------------------------------------------------- 1 |

Here is a block tag ins:

2 | 3 | 4 |

Some text

5 |
6 | 7 |

And here it is inside a paragraph.

8 | 9 |

And here it is in the middle of a paragraph.

10 | 11 | 12 |

Some text

13 |
14 | 15 |

And here is ins as a paragraph.

16 | 17 |

And here it is in the middle of a paragraph.

18 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Links, inline style.text: -------------------------------------------------------------------------------- 1 | [silly URL w/ angle brackets](). 2 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Links, inline style.xhtml: -------------------------------------------------------------------------------- 1 |

silly URL w/ angle brackets.

2 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/MD5 Hashes.text: -------------------------------------------------------------------------------- 1 | # Character Escapes 2 | 3 | The MD5 value for `+` is "26b17225b626fb9238849fd60eabdf60". 4 | 5 | # HTML Blocks 6 | 7 |

test

8 | 9 | The MD5 value for `

test

` is: 10 | 11 | 6205333b793f34273d75379350b36826 -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/MD5 Hashes.xhtml: -------------------------------------------------------------------------------- 1 |

Character Escapes

2 | 3 |

The MD5 value for + is "26b17225b626fb9238849fd60eabdf60".

4 | 5 |

HTML Blocks

6 | 7 |

test

8 | 9 |

The MD5 value for <p>test</p> is:

10 | 11 |

6205333b793f34273d75379350b36826

12 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Mixed OLs and ULs.text: -------------------------------------------------------------------------------- 1 | * test 2 | + test 3 | - test 4 | 5 | 1. test 6 | 2. test 7 | 8 | * test 9 | + test 10 | - test 11 | 12 | 1. test 13 | 2. test 14 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Mixed OLs and ULs.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • test
  • 3 |
  • test
  • 4 |
  • test
  • 5 |
6 | 7 |
    8 |
  1. test
  2. 9 |
  3. test
  4. 10 |
11 | 12 |
    13 |
  • test
  • 14 |
  • test
  • 15 |
  • test
  • 16 |
17 | 18 |
    19 |
  1. test
  2. 20 |
  3. test
  4. 21 |
22 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Nesting.text: -------------------------------------------------------------------------------- 1 | Valid nesting: 2 | 3 | **[Link](url)** 4 | 5 | [**Link**](url) 6 | 7 | **[**Link**](url)** 8 | 9 | Invalid nesting: 10 | 11 | [[Link](url)](url) -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Nesting.xhtml: -------------------------------------------------------------------------------- 1 |

Valid nesting:

2 | 3 |

Link

4 | 5 |

Link

6 | 7 |

Link

8 | 9 |

Invalid nesting:

10 | 11 |

[Link](url)

12 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/PHP-Specific Bugs.text: -------------------------------------------------------------------------------- 1 | This tests for a bug where quotes escaped by PHP when using 2 | `preg_replace` with the `/e` modifier must be correctly unescaped 3 | (hence the `_UnslashQuotes` function found only in PHP Markdown). 4 | 5 | 6 | 7 | Headers below should appear exactly as they are typed (no backslash 8 | added or removed). 9 | 10 | Header "quoted\" again \\"" 11 | =========================== 12 | 13 | Header "quoted\" again \\"" 14 | --------------------------- 15 | 16 | ### Header "quoted\" again \\"" ### 17 | 18 | 19 | 20 | Test with tabs for `_Detab`: 21 | 22 | Code 'block' with some "tabs" and "quotes" 23 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/PHP-Specific Bugs.xhtml: -------------------------------------------------------------------------------- 1 |

This tests for a bug where quotes escaped by PHP when using 2 | preg_replace with the /e modifier must be correctly unescaped 3 | (hence the _UnslashQuotes function found only in PHP Markdown).

4 | 5 |

Headers below should appear exactly as they are typed (no backslash 6 | added or removed).

7 | 8 |

Header "quoted\" again \""

9 | 10 |

Header "quoted\" again \""

11 | 12 |

Header "quoted\" again \""

13 | 14 |

Test with tabs for _Detab:

15 | 16 |
Code    'block' with    some    "tabs"  and "quotes"
17 | 
18 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Parens in URL.text: -------------------------------------------------------------------------------- 1 | [Inline link 1 with parens](/url\(test\) "title"). 2 | 3 | [Inline link 2 with parens]( "title"). 4 | 5 | [Inline link 3 with non-escaped parens](/url(test) "title"). 6 | 7 | [Inline link 4 with non-escaped parens]( "title"). 8 | 9 | [Reference link 1 with parens][1]. 10 | 11 | [Reference link 2 with parens][2]. 12 | 13 | [1]: /url(test) "title" 14 | [2]: "title" 15 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Parens in URL.xhtml: -------------------------------------------------------------------------------- 1 |

Inline link 1 with parens.

2 | 3 |

Inline link 2 with parens.

4 | 5 |

Inline link 3 with non-escaped parens.

6 | 7 |

Inline link 4 with non-escaped parens.

8 | 9 |

Reference link 1 with parens.

10 | 11 |

Reference link 2 with parens.

-------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Quotes in attributes.text: -------------------------------------------------------------------------------- 1 | [Test](/"style="color:red) 2 | [Test](/'style='color:red) 3 | 4 | ![](/"style="border-color:red;border-size:1px;border-style:solid) 5 | ![](/'style='border-color:red;border-size:1px;border-style:solid) 6 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Quotes in attributes.xhtml: -------------------------------------------------------------------------------- 1 |

Test 2 | Test

3 | 4 |

5 |

6 | -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Tight blocks.text: -------------------------------------------------------------------------------- 1 | Paragraph and no space: * ciao Paragraph and 1 space: * ciao Paragraph and 3 spaces: * ciao Paragraph and 4 spaces: * ciao Paragraph before header: #Header Paragraph before blockquote: >Some quote. -------------------------------------------------------------------------------- /test/mdtest1.1/PHP Markdown.mdtest/Tight blocks.xhtml: -------------------------------------------------------------------------------- 1 |

Paragraph and no space: 2 | * ciao

3 | 4 |

Paragraph and 1 space: 5 | * ciao

6 | 7 |

Paragraph and 3 spaces: 8 | * ciao

9 | 10 |

Paragraph and 4 spaces: 11 | * ciao

12 | 13 |

Paragraph before header:

14 | 15 |

Header

16 | 17 |

Paragraph before blockquote:

18 | 19 |
20 |

Some quote.

21 |
22 | -------------------------------------------------------------------------------- /test/spec/basics/code-block.md: -------------------------------------------------------------------------------- 1 | If you want your page to validate under XHTML 1.0 Strict, 2 | you've got to put paragraph tags in your blockquotes: 3 | 4 |
5 |

For example.

6 |
-------------------------------------------------------------------------------- /test/spec/basics/code-block.xhtml: -------------------------------------------------------------------------------- 1 |

If you want your page to validate under XHTML 1.0 Strict, 2 | you've got to put paragraph tags in your blockquotes:

3 | 4 |
<blockquote>
5 |     <p>For example.</p>
6 | </blockquote>
7 | 
-------------------------------------------------------------------------------- /test/spec/basics/code-inline.md: -------------------------------------------------------------------------------- 1 | I strongly recommend against using any `` tags. 2 | 3 | I wish SmartyPants used named entities like `—` 4 | instead of decimal-encoded entites like `—`. -------------------------------------------------------------------------------- /test/spec/basics/code-inline.xhtml: -------------------------------------------------------------------------------- 1 |

I strongly recommend against using any 2 | <blink> tags.

3 | 4 |

I wish SmartyPants used named entities like 5 | &mdash; instead of decimal-encoded 6 | entites like &#8212;.

-------------------------------------------------------------------------------- /test/spec/basics/emphasis.md: -------------------------------------------------------------------------------- 1 | Some of these words *are emphasized*. 2 | Some of these words _are emphasized also_. 3 | 4 | Use two asterisks for **strong emphasis**. 5 | Or, if you prefer, __use two underscores instead__. -------------------------------------------------------------------------------- /test/spec/basics/emphasis.xhtml: -------------------------------------------------------------------------------- 1 |

Some of these words are emphasized. 2 | Some of these words are emphasized also.

3 | 4 |

Use two asterisks for strong emphasis. 5 | Or, if you prefer, use two underscores instead.

-------------------------------------------------------------------------------- /test/spec/basics/headers.md: -------------------------------------------------------------------------------- 1 | A First Level Header 2 | ==================== 3 | 4 | A Second Level Header 5 | --------------------- 6 | 7 | Now is the time for all good men to come to 8 | the aid of their country. This is just a 9 | regular paragraph. 10 | 11 | The quick brown fox jumped over the lazy 12 | dog's back. 13 | 14 | ### Header 3 15 | 16 | > This is a blockquote. 17 | > 18 | > This is the second paragraph in the blockquote. 19 | > 20 | > ## This is an H2 in a blockquote -------------------------------------------------------------------------------- /test/spec/basics/headers.xhtml: -------------------------------------------------------------------------------- 1 |

A First Level Header

2 | 3 |

A Second Level Header

4 | 5 |

Now is the time for all good men to come to 6 | the aid of their country. This is just a 7 | regular paragraph.

8 | 9 |

The quick brown fox jumped over the lazy 10 | dog's back.

11 | 12 |

Header 3

13 | 14 |
15 |

This is a blockquote.

16 | 17 |

This is the second paragraph in the blockquote.

18 | 19 |

This is an H2 in a blockquote

20 |
-------------------------------------------------------------------------------- /test/spec/basics/images-inline.md: -------------------------------------------------------------------------------- 1 | ![alt text](/path/to/img.jpg "Title") -------------------------------------------------------------------------------- /test/spec/basics/images-inline.xhtml: -------------------------------------------------------------------------------- 1 | alt text -------------------------------------------------------------------------------- /test/spec/basics/images-references.md: -------------------------------------------------------------------------------- 1 | ![alt text][id] 2 | 3 | [id]: /path/to/img.jpg "Title" -------------------------------------------------------------------------------- /test/spec/basics/images-references.xtml: -------------------------------------------------------------------------------- 1 | alt text -------------------------------------------------------------------------------- /test/spec/basics/inline-links-title.md: -------------------------------------------------------------------------------- 1 | This is an [example link](http://example.com/ "With a Title"). -------------------------------------------------------------------------------- /test/spec/basics/inline-links-title.xhtml: -------------------------------------------------------------------------------- 1 |

This is an 2 | example link.

-------------------------------------------------------------------------------- /test/spec/basics/inline-links.md: -------------------------------------------------------------------------------- 1 | This is an [example link](http://example.com/). -------------------------------------------------------------------------------- /test/spec/basics/inline-links.xhtml: -------------------------------------------------------------------------------- 1 |

This is an 2 | example link.

-------------------------------------------------------------------------------- /test/spec/basics/lists-1.md: -------------------------------------------------------------------------------- 1 | * Candy. 2 | * Gum. 3 | * Booze. -------------------------------------------------------------------------------- /test/spec/basics/lists-1.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • Candy.
  • 3 |
  • Gum.
  • 4 |
  • Booze.
  • 5 |
-------------------------------------------------------------------------------- /test/spec/basics/lists-2.md: -------------------------------------------------------------------------------- 1 | + Candy. 2 | + Gum. 3 | + Booze. -------------------------------------------------------------------------------- /test/spec/basics/lists-2.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • Candy.
  • 3 |
  • Gum.
  • 4 |
  • Booze.
  • 5 |
-------------------------------------------------------------------------------- /test/spec/basics/lists-3.md: -------------------------------------------------------------------------------- 1 | - Candy. 2 | - Gum. 3 | - Booze. -------------------------------------------------------------------------------- /test/spec/basics/lists-3.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • Candy.
  • 3 |
  • Gum.
  • 4 |
  • Booze.
  • 5 |
-------------------------------------------------------------------------------- /test/spec/basics/lists-with-blanks.md: -------------------------------------------------------------------------------- 1 | * A list item. 2 | 3 | With multiple paragraphs. 4 | 5 | * Another item in the list. -------------------------------------------------------------------------------- /test/spec/basics/lists-with-blanks.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • A list item.

    3 |

    With multiple paragraphs.

  • 4 |
  • Another item in the list.

  • 5 |
-------------------------------------------------------------------------------- /test/spec/basics/ordered.md: -------------------------------------------------------------------------------- 1 | 1. Red 2 | 2. Green 3 | 3. Blue -------------------------------------------------------------------------------- /test/spec/basics/ordered.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  1. Red
  2. 3 |
  3. Green
  4. 4 |
  5. Blue
  6. 5 |
-------------------------------------------------------------------------------- /test/spec/basics/references-with-names.md: -------------------------------------------------------------------------------- 1 | I start my morning with a cup of coffee and 2 | [The New York Times][NY Times]. 3 | 4 | [ny times]: http://www.nytimes.com/ -------------------------------------------------------------------------------- /test/spec/basics/references-with-names.xhtml: -------------------------------------------------------------------------------- 1 |

I start my morning with a cup of coffee and 2 | The New York Times.

-------------------------------------------------------------------------------- /test/spec/basics/references.md: -------------------------------------------------------------------------------- 1 | I get 10 times more traffic from [Google][1] than from 2 | [Yahoo][2] or [MSN][3]. 3 | 4 | [1]: http://google.com/ "Google" 5 | [2]: http://search.yahoo.com/ "Yahoo Search" 6 | [3]: http://search.msn.com/ "MSN Search" -------------------------------------------------------------------------------- /test/spec/basics/references.xhtml: -------------------------------------------------------------------------------- 1 |

I get 10 times more traffic from Google than from Yahoo or MSN.

-------------------------------------------------------------------------------- /test/spec/syntax/auto-escaping.md: -------------------------------------------------------------------------------- 1 | http://images.google.com/images?num=30&q=larry+bird 2 | 3 | © 4 | 5 | AT&T 6 | 7 | 4 < 5 -------------------------------------------------------------------------------- /test/spec/syntax/auto-escaping.xhtml: -------------------------------------------------------------------------------- 1 |

http://images.google.com/images?num=30&q=larry+bird

2 | 3 |

©

4 | 5 |

AT&T

6 | 7 |

4 < 5

-------------------------------------------------------------------------------- /test/spec/syntax/autolinks.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/spec/syntax/autolinks.xhtml: -------------------------------------------------------------------------------- 1 | http://example.com/ 2 | 3 | address@exa 6 | mple.com -------------------------------------------------------------------------------- /test/spec/syntax/blockquotes.md: -------------------------------------------------------------------------------- 1 | > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, 2 | > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. 3 | > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. 4 | > 5 | > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse 6 | > id sem consectetuer libero luctus adipiscing. 7 | 8 | > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, 9 | consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. 10 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. 11 | 12 | > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse 13 | id sem consectetuer libero luctus adipiscing. 14 | 15 | > This is the first level of quoting. 16 | > 17 | > > This is nested blockquote. 18 | > 19 | > Back to the first level. 20 | 21 | > ## This is a header. 22 | > 23 | > 1. This is the first list item. 24 | > 2. This is the second list item. 25 | > 26 | > Here's some example code: 27 | > 28 | > return shell_exec("echo $input | $markdown_script"); -------------------------------------------------------------------------------- /test/spec/syntax/code-inline.md: -------------------------------------------------------------------------------- 1 | Use the `printf()` function. 2 | 3 | ``There is a literal backtick (`) here.`` 4 | 5 | A single backtick in a code span: `` ` `` 6 | 7 | A backtick-delimited string in a code span: `` `foo` `` 8 | 9 | Please don't use any `` tags. 10 | 11 | `—` is the decimal-encoded equivalent of `—`. -------------------------------------------------------------------------------- /test/spec/syntax/code-inline.xhtml: -------------------------------------------------------------------------------- 1 |

Use the printf() function.

2 | 3 |

There is a literal backtick (`) here.

4 | 5 |

A single backtick in a code span: `

6 | 7 |

A backtick-delimited string in a code span: `foo`

8 | 9 |

Please don't use any <blink> tags.

10 | 11 |

&#8212; is the decimal-encoded 12 | equivalent of &mdash;.

-------------------------------------------------------------------------------- /test/spec/syntax/code.md: -------------------------------------------------------------------------------- 1 | This is a normal paragraph: 2 | 3 | This is a code block. 4 | 5 | Here is an example of AppleScript: 6 | 7 | tell application "Foo" 8 | beep 9 | end tell 10 | 11 | Test Foo: 12 | 13 | -------------------------------------------------------------------------------- /test/spec/syntax/code.xhtml: -------------------------------------------------------------------------------- 1 |

This is a normal paragraph:

2 | 3 |
This is a code block.
 4 | 
5 | 6 |

Here is an example of AppleScript:

7 | 8 |
tell application "Foo"
 9 |     beep
10 | end tell
11 | 
12 | 13 |

Test Foo:

14 | 15 |
<div class="footer">
16 |     &copy; 2004 Foo Corporation
17 | </div>
18 | 
-------------------------------------------------------------------------------- /test/spec/syntax/complex-lists.md: -------------------------------------------------------------------------------- 1 | * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 2 | Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, 3 | viverra nec, fringilla in, laoreet vitae, risus. 4 | * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 5 | Suspendisse id sem consectetuer libero luctus adipiscing. 6 | 7 | * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 8 | Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, 9 | viverra nec, fringilla in, laoreet vitae, risus. 10 | * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. 11 | Suspendisse id sem consectetuer libero luctus adipiscing. 12 | 13 | 1. This is a list item with two paragraphs. Lorem ipsum dolor 14 | sit amet, consectetuer adipiscing elit. Aliquam hendrerit 15 | mi posuere lectus. 16 | 17 | Vestibulum enim wisi, viverra nec, fringilla in, laoreet 18 | vitae, risus. Donec sit amet nisl. Aliquam semper ipsum 19 | sit amet velit. 20 | 21 | 2. Suspendisse id sem consectetuer libero luctus adipiscing. 22 | 23 | * This is a list item with two paragraphs. 24 | 25 | This is the second paragraph in the list item. You're 26 | only required to indent the first line. Lorem ipsum dolor 27 | sit amet, consectetuer adipiscing elit. 28 | 29 | * Another item in the same list. 30 | 31 | * A list item with a blockquote: 32 | 33 | > This is a blockquote 34 | > inside a list item. 35 | 36 | * A list item with a code block: 37 | 38 | 39 | 40 | 1986. What a great season. 41 | 42 | 1986\. What a great season. -------------------------------------------------------------------------------- /test/spec/syntax/emphasis.md: -------------------------------------------------------------------------------- 1 | *single asterisks* 2 | 3 | _single underscores_ 4 | 5 | **double asterisks** 6 | 7 | __double underscores__ 8 | 9 | `not_to_emphase` 10 | 11 | un*frigging*believable 12 | 13 | \*this text is surrounded by literal asterisks\* -------------------------------------------------------------------------------- /test/spec/syntax/emphasis.xhtml: -------------------------------------------------------------------------------- 1 | single asterisks 2 | 3 | single underscores 4 | 5 | double asterisks 6 | 7 | double underscores 8 | 9 | not_to_emphase 10 | 11 |

unfriggingbelievable

12 | 13 | \*this text is surrounded by literal asterisks\* -------------------------------------------------------------------------------- /test/spec/syntax/headers.md: -------------------------------------------------------------------------------- 1 | This is an H1 2 | ============= 3 | 4 | This is an H2 5 | ------------- 6 | 7 | # This is an H1 8 | 9 | ## This is an H2 10 | 11 | ###### This is an H6 12 | 13 | # This is an H1 # 14 | 15 | ## This is an H2 ## 16 | 17 | ### This is an H3 ###### -------------------------------------------------------------------------------- /test/spec/syntax/hrules.md: -------------------------------------------------------------------------------- 1 | * * * 2 | 3 | *** 4 | 5 | ***** 6 | 7 | - - - 8 | 9 | --------------------------------------- -------------------------------------------------------------------------------- /test/spec/syntax/hrules.xhtml: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 | 7 |
8 | 9 |
-------------------------------------------------------------------------------- /test/spec/syntax/images.md: -------------------------------------------------------------------------------- 1 | ![Alt text](/path/to/img.jpg) 2 | 3 | ![Alt text](/path/to/img.jpg "Optional title") 4 | 5 | ![Alt text][id] 6 | 7 | [id]: url/to/image "Optional title attribute" -------------------------------------------------------------------------------- /test/spec/syntax/inline-html.md: -------------------------------------------------------------------------------- 1 | This is a regular paragraph. 2 | 3 | 4 | 5 | 6 | 7 |
Foo
8 | 9 | This is another regular paragraph. -------------------------------------------------------------------------------- /test/spec/syntax/links.md: -------------------------------------------------------------------------------- 1 | This is [an example](http://example.com/ "Title") inline link. 2 | 3 | [This link](http://example.net/) has no title attribute. 4 | 5 | See my [About](/about/) page for details. 6 | 7 | This is [an example][id] reference-style link. 8 | 9 | This is [an example] [id] reference-style link. 10 | 11 | [id]: http://example.com/ "Optional Title Here" 12 | 13 | [Foo 1][], [Foo 2][] [Foo 3][] [With.Dots & symbs][] 14 | 15 | [foo 1]: http://example.com/ "Optional Title Here" 16 | [foo 2]: http://example.com/ 'Optional Title Here' 17 | [foo 3]: http://example.com/ (Optional Title Here) 18 | [With.Dots & symbs]: "Optional Title Here" 19 | 20 | [recourses hEre][] 21 | 22 | [recourses here]: http://example.com/longish/path/to/resource/here 23 | "Optional Title Here" 24 | 25 | [Yandex][] 26 | 27 | [Yandex]: http://yandex.ru/ 28 | 29 | Visit [Daring Fireball][] for more information. 30 | 31 | [Daring Fireball]: http://daringfireball.net/ 32 | 33 | I get 10 times more traffic from [Google] [1] than from 34 | [Yahoo] [2] or [MSN] [3]. 35 | 36 | [1]: http://google.com/ "Google" 37 | [2]: http://search.yahoo.com/ "Yahoo Search" 38 | [3]: http://search.msn.com/ "MSN Search" 39 | 40 | I get 10 times more traffic from [Google][] than from 41 | [Yahoo][] or [MSN][]. 42 | 43 | [google]: http://google.com/ "Google" 44 | [yahoo]: http://search.yahoo.com/ "Yahoo Search" 45 | [msn]: http://search.msn.com/ "MSN Search" 46 | 47 | I get 10 times more traffic from [Google](http://google.com/ "Google") 48 | than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or 49 | [MSN](http://search.msn.com/ "MSN Search"). 50 | 51 | -------------------------------------------------------------------------------- /test/spec/syntax/links.xhtml: -------------------------------------------------------------------------------- 1 |

I get 10 times more traffic from Google than from 3 | Yahoo 4 | or MSN.

-------------------------------------------------------------------------------- /test/spec/syntax/lists-1.md: -------------------------------------------------------------------------------- 1 | * Red 2 | * Green 3 | * Blue 4 | 5 | + Red 6 | + Green 7 | + Blue 8 | 9 | - Red 10 | - Green 11 | - Blue 12 | 13 | 1. Bird 14 | 2. McHale 15 | 3. Parish 16 | 17 | 1. Bird 18 | 1. McHale 19 | 1. Parish 20 | 21 | 3. Bird 22 | 1. McHale 23 | 8. Parish 24 | 25 | * Bird 26 | * Magic 27 | 28 | * Bird 29 | 30 | * Magic -------------------------------------------------------------------------------- /test/spec/syntax/lists-1.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |
  • Red
  • 3 |
  • Green
  • 4 |
  • Blue
  • 5 |
6 | 7 |
    8 |
  • Red
  • 9 |
  • Green
  • 10 |
  • Blue
  • 11 |
12 | 13 |
    14 |
  • Red
  • 15 |
  • Green
  • 16 |
  • Blue
  • 17 |
18 | 19 |
    20 |
  1. Bird
  2. 21 |
  3. McHale
  4. 22 |
  5. Parish
  6. 23 |
24 | 25 |
    26 |
  1. Bird
  2. 27 |
  3. McHale
  4. 28 |
  5. Parish
  6. 29 |
30 | 31 |
    32 |
  1. Bird
  2. 33 |
  3. McHale
  4. 34 |
  5. Parish
  6. 35 |
36 | 37 |
    38 |
  • Bird
  • 39 |
  • Magic
  • 40 |
41 | 42 |
    43 |
  • Bird

  • 44 |
  • Magic

  • 45 |
--------------------------------------------------------------------------------