├── CNAME ├── LICENSE ├── README.md ├── app └── bower_components │ ├── marked │ ├── .bower.json │ ├── .gitignore │ ├── .npmignore │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── bin │ │ └── marked │ ├── component.json │ ├── doc │ │ ├── broken.md │ │ └── todo.md │ ├── index.js │ ├── lib │ │ └── marked.js │ ├── man │ │ └── marked.1 │ ├── package.json │ └── test │ │ ├── README │ │ ├── browser │ │ ├── index.html │ │ ├── index.js │ │ └── test.js │ │ ├── index.js │ │ ├── new │ │ ├── autolink_lines.html │ │ ├── autolink_lines.text │ │ ├── blockquote_list_item.html │ │ ├── blockquote_list_item.text │ │ ├── case_insensitive_refs.html │ │ ├── case_insensitive_refs.text │ │ ├── def_blocks.html │ │ ├── def_blocks.text │ │ ├── double_link.html │ │ ├── double_link.text │ │ ├── escaped_angles.html │ │ ├── escaped_angles.text │ │ ├── gfm_break.breaks.html │ │ ├── gfm_break.breaks.text │ │ ├── gfm_code.html │ │ ├── gfm_code.text │ │ ├── gfm_code_hr_list.html │ │ ├── gfm_code_hr_list.text │ │ ├── gfm_del.html │ │ ├── gfm_del.text │ │ ├── gfm_em.html │ │ ├── gfm_em.text │ │ ├── gfm_links.html │ │ ├── gfm_links.text │ │ ├── gfm_tables.html │ │ ├── gfm_tables.text │ │ ├── hr_list_break.html │ │ ├── hr_list_break.text │ │ ├── lazy_blockquotes.html │ │ ├── lazy_blockquotes.text │ │ ├── list_item_text.html │ │ ├── list_item_text.text │ │ ├── loose_lists.html │ │ ├── loose_lists.text │ │ ├── main.html │ │ ├── main.text │ │ ├── nested_code.html │ │ ├── nested_code.text │ │ ├── nested_em.html │ │ ├── nested_em.text │ │ ├── nested_square_link.html │ │ ├── nested_square_link.text │ │ ├── not_a_link.html │ │ ├── not_a_link.text │ │ ├── ref_paren.html │ │ ├── ref_paren.text │ │ ├── same_bullet.html │ │ ├── same_bullet.text │ │ ├── text.smartypants.html │ │ ├── text.smartypants.text │ │ ├── toplevel_paragraphs.gfm.html │ │ ├── toplevel_paragraphs.gfm.text │ │ ├── tricky_list.html │ │ └── tricky_list.text │ │ ├── original │ │ ├── amps_and_angles_encoding.html │ │ ├── amps_and_angles_encoding.text │ │ ├── auto_links.html │ │ ├── auto_links.text │ │ ├── backslash_escapes.html │ │ ├── backslash_escapes.text │ │ ├── blockquotes_with_code_blocks.html │ │ ├── blockquotes_with_code_blocks.text │ │ ├── code_blocks.html │ │ ├── code_blocks.text │ │ ├── code_spans.html │ │ ├── code_spans.text │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.html │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.text │ │ ├── horizontal_rules.html │ │ ├── horizontal_rules.text │ │ ├── inline_html_advanced.html │ │ ├── inline_html_advanced.text │ │ ├── inline_html_comments.html │ │ ├── inline_html_comments.text │ │ ├── inline_html_simple.html │ │ ├── inline_html_simple.text │ │ ├── links_inline_style.html │ │ ├── links_inline_style.text │ │ ├── links_reference_style.html │ │ ├── links_reference_style.text │ │ ├── links_shortcut_references.html │ │ ├── links_shortcut_references.text │ │ ├── literal_quotes_in_titles.html │ │ ├── literal_quotes_in_titles.text │ │ ├── markdown_documentation_basics.html │ │ ├── markdown_documentation_basics.text │ │ ├── markdown_documentation_syntax.html │ │ ├── markdown_documentation_syntax.text │ │ ├── nested_blockquotes.html │ │ ├── nested_blockquotes.text │ │ ├── ordered_and_unordered_lists.html │ │ ├── ordered_and_unordered_lists.text │ │ ├── strong_and_em_together.html │ │ ├── strong_and_em_together.text │ │ ├── tabs.html │ │ ├── tabs.text │ │ ├── tidyness.html │ │ └── tidyness.text │ │ └── tests │ │ ├── amps_and_angles_encoding.html │ │ ├── amps_and_angles_encoding.text │ │ ├── auto_links.html │ │ ├── auto_links.text │ │ ├── autolink_lines.html │ │ ├── autolink_lines.text │ │ ├── backslash_escapes.html │ │ ├── backslash_escapes.text │ │ ├── blockquote_list_item.html │ │ ├── blockquote_list_item.text │ │ ├── blockquotes_with_code_blocks.html │ │ ├── blockquotes_with_code_blocks.text │ │ ├── case_insensitive_refs.html │ │ ├── case_insensitive_refs.text │ │ ├── code_blocks.html │ │ ├── code_blocks.text │ │ ├── code_spans.html │ │ ├── code_spans.text │ │ ├── def_blocks.html │ │ ├── def_blocks.text │ │ ├── double_link.html │ │ ├── double_link.text │ │ ├── escaped_angles.html │ │ ├── escaped_angles.text │ │ ├── gfm_break.breaks.html │ │ ├── gfm_break.breaks.text │ │ ├── gfm_code.html │ │ ├── gfm_code.text │ │ ├── gfm_code_hr_list.html │ │ ├── gfm_code_hr_list.text │ │ ├── gfm_del.html │ │ ├── gfm_del.text │ │ ├── gfm_em.html │ │ ├── gfm_em.text │ │ ├── gfm_links.html │ │ ├── gfm_links.text │ │ ├── gfm_tables.html │ │ ├── gfm_tables.text │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.nogfm.html │ │ ├── hard_wrapped_paragraphs_with_list_like_lines.nogfm.text │ │ ├── horizontal_rules.html │ │ ├── horizontal_rules.text │ │ ├── hr_list_break.html │ │ ├── hr_list_break.text │ │ ├── inline_html_advanced.html │ │ ├── inline_html_advanced.text │ │ ├── inline_html_comments.html │ │ ├── inline_html_comments.text │ │ ├── inline_html_simple.html │ │ ├── inline_html_simple.text │ │ ├── lazy_blockquotes.html │ │ ├── lazy_blockquotes.text │ │ ├── links_inline_style.html │ │ ├── links_inline_style.text │ │ ├── links_reference_style.html │ │ ├── links_reference_style.text │ │ ├── links_shortcut_references.html │ │ ├── links_shortcut_references.text │ │ ├── list_item_text.html │ │ ├── list_item_text.text │ │ ├── literal_quotes_in_titles.html │ │ ├── literal_quotes_in_titles.text │ │ ├── loose_lists.html │ │ ├── loose_lists.text │ │ ├── main.html │ │ ├── main.text │ │ ├── markdown_documentation_basics.html │ │ ├── markdown_documentation_basics.text │ │ ├── markdown_documentation_syntax.html │ │ ├── markdown_documentation_syntax.text │ │ ├── nested_blockquotes.html │ │ ├── nested_blockquotes.text │ │ ├── nested_code.html │ │ ├── nested_code.text │ │ ├── nested_em.html │ │ ├── nested_em.text │ │ ├── nested_square_link.html │ │ ├── nested_square_link.text │ │ ├── not_a_link.html │ │ ├── not_a_link.text │ │ ├── ordered_and_unordered_lists.html │ │ ├── ordered_and_unordered_lists.text │ │ ├── ref_paren.html │ │ ├── ref_paren.text │ │ ├── same_bullet.html │ │ ├── same_bullet.text │ │ ├── strong_and_em_together.html │ │ ├── strong_and_em_together.text │ │ ├── tabs.html │ │ ├── tabs.text │ │ ├── text.smartypants.html │ │ ├── text.smartypants.text │ │ ├── tidyness.html │ │ ├── tidyness.text │ │ ├── toplevel_paragraphs.gfm.html │ │ ├── toplevel_paragraphs.gfm.text │ │ ├── tricky_list.html │ │ └── tricky_list.text │ └── normalize-css │ ├── .bower.json │ ├── LICENSE.md │ ├── README.md │ ├── bower.json │ └── normalize.css ├── css ├── app.css └── normalize.css ├── docs ├── array.md ├── arraybuffer.md ├── async.md ├── class.md ├── decorator.md ├── destructuring.md ├── function.md ├── generator.md ├── intro.md ├── iterator.md ├── let.md ├── module.md ├── number.md ├── object.md ├── promise.md ├── proxy.md ├── reference.md ├── regex.md ├── set-map.md ├── string.md ├── style.md └── symbol.md ├── favicon.ico ├── images ├── copyright.png ├── cover.jpg ├── cover_thumbnail.jpg ├── page1.png └── page2.png ├── index.html ├── js ├── ditto.js ├── jquery-1.11.0.min.js ├── jquery-ui.min.js ├── marked.js ├── prism.js └── store.js └── sidebar.md /CNAME: -------------------------------------------------------------------------------- 1 | es6.ruanyifeng.com 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # Creative Commons Attribution-NonCommercial 4.0 International License 2 | 3 | Disclaimer: This is a human-readable summary of (and not a substitute for) the [license](http://creativecommons.org/licenses/by-nc/4.0/legalcode). 4 | 5 | You are free to: 6 | 7 | - Share — copy and redistribute the material in any medium or format 8 | - Adapt — remix, transform, and build upon the material 9 | 10 | The licensor cannot revoke these freedoms as long as you follow the license terms. 11 | 12 | Under the following terms: 13 | 14 | - Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. 15 | - NonCommercial — You may not use the material for commercial purposes. 16 | - No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. 17 | 18 | Notices: 19 | 20 | You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. 21 | 22 | No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ECMAScript 6入门 2 | 3 | 《ECMAScript 6入门》是一本开源的JavaScript语言教程,全面介绍ECMAScript 6新引入的语法特性。 4 | 5 | [![cover](images/cover_thumbnail.jpg)](images/cover.jpg) 6 | 7 | 本书力争覆盖ES6与ES5的所有不同之处,对涉及的语法知识给予详细介绍,并给出大量简洁易懂的示例代码。 8 | 9 | 本书为中级难度,适合已有一定JavaScript语言基础的读者,用来了解这门语言的最新发展;也可当作参考手册,查寻新增的语法点。 10 | 11 | 全书第一版已由电子工业出版社于2014年10月出版([版权页](images/copyright.png),[内页1](images/page1.png),[内页2](images/page2.png)),铜版纸全彩印刷,附有索引。目前,网站的内容是第二版的初稿,预订2016年年初出版。感谢张春雨编辑支持我将全书开源的做法。如果您对本书感兴趣,建议考虑购买纸版。这样可以使出版社不因出版开源书籍而亏钱,进而鼓励更多的作者开源自己的书籍。 12 | 13 | - [京东](http://item.jd.com/11526272.html) 14 | - [当当](http://product.dangdang.com/23546442.html) 15 | - [亚马逊](http://www.amazon.cn/%E5%9B%BE%E4%B9%A6/dp/B00MQKRLD6/) 16 | - [China-pub](http://product.china-pub.com/4284817) 17 | 18 | ### 版权许可 19 | 20 | 本书采用“保持署名—非商用”创意共享4.0许可证。 21 | 22 | 只要保持原作者署名和非商用,您可以自由地阅读、分享、修改本书。 23 | 24 | 详细的法律条文请参见[创意共享](http://creativecommons.org/licenses/by-nc/4.0/)网站。 25 | -------------------------------------------------------------------------------- /app/bower_components/marked/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "homepage": "https://github.com/chjj/marked", 4 | "version": "0.3.2", 5 | "_release": "0.3.2", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v0.3.2", 9 | "commit": "43db549e31af5ff6e4a3b12e41a23513b9f88c99" 10 | }, 11 | "_source": "git://github.com/chjj/marked.git", 12 | "_target": "~0.3.2", 13 | "_originalSource": "marked", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /app/bower_components/marked/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | test/ 3 | -------------------------------------------------------------------------------- /app/bower_components/marked/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.8" 5 | - "0.6" 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/bower_components/marked/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | @cp lib/marked.js marked.js 3 | @uglifyjs -o marked.min.js marked.js 4 | 5 | clean: 6 | @rm marked.js 7 | @rm marked.min.js 8 | 9 | bench: 10 | @node test --bench 11 | 12 | .PHONY: clean all 13 | -------------------------------------------------------------------------------- /app/bower_components/marked/bin/marked: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Marked CLI 5 | * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) 6 | */ 7 | 8 | var fs = require('fs') 9 | , util = require('util') 10 | , marked = require('../'); 11 | 12 | /** 13 | * Man Page 14 | */ 15 | 16 | function help() { 17 | var spawn = require('child_process').spawn; 18 | 19 | var options = { 20 | cwd: process.cwd(), 21 | env: process.env, 22 | setsid: false, 23 | customFds: [0, 1, 2] 24 | }; 25 | 26 | spawn('man', 27 | [__dirname + '/../man/marked.1'], 28 | options); 29 | } 30 | 31 | /** 32 | * Main 33 | */ 34 | 35 | function main(argv, callback) { 36 | var files = [] 37 | , options = {} 38 | , input 39 | , output 40 | , arg 41 | , tokens 42 | , opt; 43 | 44 | function getarg() { 45 | var arg = argv.shift(); 46 | 47 | if (arg.indexOf('--') === 0) { 48 | // e.g. --opt 49 | arg = arg.split('='); 50 | if (arg.length > 1) { 51 | // e.g. --opt=val 52 | argv.unshift(arg.slice(1).join('=')); 53 | } 54 | arg = arg[0]; 55 | } else if (arg[0] === '-') { 56 | if (arg.length > 2) { 57 | // e.g. -abc 58 | argv = arg.substring(1).split('').map(function(ch) { 59 | return '-' + ch; 60 | }).concat(argv); 61 | arg = argv.shift(); 62 | } else { 63 | // e.g. -a 64 | } 65 | } else { 66 | // e.g. foo 67 | } 68 | 69 | return arg; 70 | } 71 | 72 | while (argv.length) { 73 | arg = getarg(); 74 | switch (arg) { 75 | case '--test': 76 | return require('../test').main(process.argv.slice()); 77 | case '-o': 78 | case '--output': 79 | output = argv.shift(); 80 | break; 81 | case '-i': 82 | case '--input': 83 | input = argv.shift(); 84 | break; 85 | case '-t': 86 | case '--tokens': 87 | tokens = true; 88 | break; 89 | case '-h': 90 | case '--help': 91 | return help(); 92 | default: 93 | if (arg.indexOf('--') === 0) { 94 | opt = camelize(arg.replace(/^--(no-)?/, '')); 95 | if (!marked.defaults.hasOwnProperty(opt)) { 96 | continue; 97 | } 98 | if (arg.indexOf('--no-') === 0) { 99 | options[opt] = typeof marked.defaults[opt] !== 'boolean' 100 | ? null 101 | : false; 102 | } else { 103 | options[opt] = typeof marked.defaults[opt] !== 'boolean' 104 | ? argv.shift() 105 | : true; 106 | } 107 | } else { 108 | files.push(arg); 109 | } 110 | break; 111 | } 112 | } 113 | 114 | function getData(callback) { 115 | if (!input) { 116 | if (files.length <= 2) { 117 | return getStdin(callback); 118 | } 119 | input = files.pop(); 120 | } 121 | return fs.readFile(input, 'utf8', callback); 122 | } 123 | 124 | return getData(function(err, data) { 125 | if (err) return callback(err); 126 | 127 | data = tokens 128 | ? JSON.stringify(marked.lexer(data, options), null, 2) 129 | : marked(data, options); 130 | 131 | if (!output) { 132 | process.stdout.write(data + '\n'); 133 | return callback(); 134 | } 135 | 136 | return fs.writeFile(output, data, callback); 137 | }); 138 | } 139 | 140 | /** 141 | * Helpers 142 | */ 143 | 144 | function getStdin(callback) { 145 | var stdin = process.stdin 146 | , buff = ''; 147 | 148 | stdin.setEncoding('utf8'); 149 | 150 | stdin.on('data', function(data) { 151 | buff += data; 152 | }); 153 | 154 | stdin.on('error', function(err) { 155 | return callback(err); 156 | }); 157 | 158 | stdin.on('end', function() { 159 | return callback(null, buff); 160 | }); 161 | 162 | try { 163 | stdin.resume(); 164 | } catch (e) { 165 | callback(e); 166 | } 167 | } 168 | 169 | function camelize(text) { 170 | return text.replace(/(\w)-(\w)/g, function(_, a, b) { 171 | return a + b.toUpperCase(); 172 | }); 173 | } 174 | 175 | /** 176 | * Expose / Entry Point 177 | */ 178 | 179 | if (!module.parent) { 180 | process.title = 'marked'; 181 | main(process.argv.slice(), function(err, code) { 182 | if (err) throw err; 183 | return process.exit(code || 0); 184 | }); 185 | } else { 186 | module.exports = main; 187 | } 188 | -------------------------------------------------------------------------------- /app/bower_components/marked/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "version": "0.3.2", 4 | "repo": "chjj/marked", 5 | "description": "A markdown parser built for speed", 6 | "keywords": ["markdown", "markup", "html"], 7 | "scripts": ["lib/marked.js"], 8 | "main": "lib/marked.js", 9 | "license": "MIT" 10 | } 11 | -------------------------------------------------------------------------------- /app/bower_components/marked/doc/broken.md: -------------------------------------------------------------------------------- 1 | # Markdown is broken 2 | 3 | I have a lot of scraps of markdown engine oddities that I've collected over the 4 | years. What you see below is slightly messy, but it's what I've managed to 5 | cobble together to illustrate the differences between markdown engines, and 6 | why, if there ever is a markdown specification, it has to be absolutely 7 | thorough. There are a lot more of these little differences I have documented 8 | elsewhere. I know I will find them lingering on my disk one day, but until 9 | then, I'll continue to add whatever strange nonsensical things I find. 10 | 11 | Some of these examples may only mention a particular engine compared to marked. 12 | However, the examples with markdown.pl could easily be swapped out for 13 | discount, upskirt, or markdown.js, and you would very easily see even more 14 | inconsistencies. 15 | 16 | A lot of this was written when I was very unsatisfied with the inconsistencies 17 | between markdown engines. Please excuse the frustration noticeable in my 18 | writing. 19 | 20 | ## Examples of markdown's "stupid" list parsing 21 | 22 | ``` 23 | $ markdown.pl 24 | 25 | * item1 26 | 27 | * item2 28 | 29 | text 30 | ^D 31 |

40 | ``` 41 | 42 | 43 | ``` 44 | $ marked 45 | * item1 46 | 47 | * item2 48 | 49 | text 50 | ^D 51 | 59 | ``` 60 | 61 | Which looks correct to you? 62 | 63 | - - - 64 | 65 | ``` 66 | $ markdown.pl 67 | * hello 68 | > world 69 | ^D 70 |

76 | 77 | ``` 78 | 79 | ``` 80 | $ marked 81 | * hello 82 | > world 83 | ^D 84 | 90 | ``` 91 | 92 | Again, which looks correct to you? 93 | 94 | - - - 95 | 96 | EXAMPLE: 97 | 98 | ``` 99 | $ markdown.pl 100 | * hello 101 | * world 102 | * hi 103 | code 104 | ^D 105 | 113 | ``` 114 | 115 | The code isn't a code block even though it's after the bullet margin. I know, 116 | lets give it two more spaces, effectively making it 8 spaces past the bullet. 117 | 118 | ``` 119 | $ markdown.pl 120 | * hello 121 | * world 122 | * hi 123 | code 124 | ^D 125 | 133 | ``` 134 | 135 | And, it's still not a code block. Did you also notice that the 3rd item isn't 136 | even its own list? Markdown screws that up too because of its indentation 137 | unaware parsing. 138 | 139 | - - - 140 | 141 | Let's look at some more examples of markdown's list parsing: 142 | 143 | ``` 144 | $ markdown.pl 145 | 146 | * item1 147 | 148 | * item2 149 | 150 | text 151 | ^D 152 |

161 | ``` 162 | 163 | Misnested tags. 164 | 165 | 166 | ``` 167 | $ marked 168 | * item1 169 | 170 | * item2 171 | 172 | text 173 | ^D 174 | 182 | ``` 183 | 184 | Which looks correct to you? 185 | 186 | - - - 187 | 188 | ``` 189 | $ markdown.pl 190 | * hello 191 | > world 192 | ^D 193 |

199 | 200 | ``` 201 | 202 | More misnested tags. 203 | 204 | 205 | ``` 206 | $ marked 207 | * hello 208 | > world 209 | ^D 210 | 216 | ``` 217 | 218 | Again, which looks correct to you? 219 | 220 | - - - 221 | 222 | # Why quality matters - Part 2 223 | 224 | ``` bash 225 | $ markdown.pl 226 | * hello 227 | > world 228 | ^D 229 |

235 | 236 | ``` 237 | 238 | ``` bash 239 | $ sundown # upskirt 240 | * hello 241 | > world 242 | ^D 243 | 247 | ``` 248 | 249 | ``` bash 250 | $ marked 251 | * hello 252 | > world 253 | ^D 254 | 255 | ``` 256 | 257 | Which looks correct to you? 258 | 259 | - - - 260 | 261 | See: https://github.com/evilstreak/markdown-js/issues/23 262 | 263 | ``` bash 264 | $ markdown.pl # upskirt/markdown.js/discount 265 | * hello 266 | var a = 1; 267 | * world 268 | ^D 269 | 274 | ``` 275 | 276 | ``` bash 277 | $ marked 278 | * hello 279 | var a = 1; 280 | * world 281 | ^D 282 | 285 | ``` 286 | 287 | Which looks more reasonable? Why shouldn't code blocks be able to appear in 288 | list items in a sane way? 289 | 290 | - - - 291 | 292 | ``` bash 293 | $ markdown.js 294 |
hello
295 | 296 | hello 297 | ^D 298 |

<div>hello</div>

299 | 300 |

<span>hello</span>

301 | ``` 302 | 303 | ``` bash 304 | $ marked 305 |
hello
306 | 307 | hello 308 | ^D 309 |
hello
310 | 311 | 312 |

hello 313 |

314 | ``` 315 | 316 | - - - 317 | 318 | See: https://github.com/evilstreak/markdown-js/issues/27 319 | 320 | ``` bash 321 | $ markdown.js 322 | [![an image](/image)](/link) 323 | ^D 324 |

![an image

325 | ``` 326 | 327 | ``` bash 328 | $ marked 329 | [![an image](/image)](/link) 330 | ^D 331 |

an image 332 |

333 | ``` 334 | 335 | - - - 336 | 337 | See: https://github.com/evilstreak/markdown-js/issues/24 338 | 339 | ``` bash 340 | $ markdown.js 341 | > a 342 | 343 | > b 344 | 345 | > c 346 | ^D 347 |

a

bundefined> c

348 | ``` 349 | 350 | ``` bash 351 | $ marked 352 | > a 353 | 354 | > b 355 | 356 | > c 357 | ^D 358 |

a 359 | 360 |

361 |

b 362 | 363 |

364 |

c 365 |

366 | ``` 367 | 368 | - - - 369 | 370 | ``` bash 371 | $ markdown.pl 372 | * hello 373 | * world 374 | how 375 | 376 | are 377 | you 378 | 379 | * today 380 | * hi 381 | ^D 382 | 398 | ``` 399 | 400 | ``` bash 401 | $ marked 402 | * hello 403 | * world 404 | how 405 | 406 | are 407 | you 408 | 409 | * today 410 | * hi 411 | ^D 412 | 426 | ``` 427 | -------------------------------------------------------------------------------- /app/bower_components/marked/doc/todo.md: -------------------------------------------------------------------------------- 1 | # Todo 2 | 3 | -------------------------------------------------------------------------------- /app/bower_components/marked/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./lib/marked'); 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/man/marked.1: -------------------------------------------------------------------------------- 1 | .ds q \N'34' 2 | .TH marked 1 "2014-01-31" "v0.3.1" "marked.js" 3 | 4 | .SH NAME 5 | marked \- a javascript markdown parser 6 | 7 | .SH SYNOPSIS 8 | .B marked 9 | [\-o \fI\fP] [\-i \fI\fP] [\-\-help] 10 | [\-\-tokens] [\-\-pedantic] [\-\-gfm] 11 | [\-\-breaks] [\-\-tables] [\-\-sanitize] 12 | [\-\-smart\-lists] [\-\-lang\-prefix \fI\fP] 13 | [\-\-no\-etc...] [\-\-silent] [\fIfilename\fP] 14 | 15 | .SH DESCRIPTION 16 | .B marked 17 | is a full-featured javascript markdown parser, built for speed. It also includes 18 | multiple GFM features. 19 | 20 | .SH EXAMPLES 21 | .TP 22 | cat in.md | marked > out.html 23 | .TP 24 | echo "hello *world*" | marked 25 | .TP 26 | marked \-o out.html in.md \-\-gfm 27 | .TP 28 | marked \-\-output="hello world.html" \-i in.md \-\-no-breaks 29 | 30 | .SH OPTIONS 31 | .TP 32 | .BI \-o,\ \-\-output\ [\fIoutput\fP] 33 | Specify file output. If none is specified, write to stdout. 34 | .TP 35 | .BI \-i,\ \-\-input\ [\fIinput\fP] 36 | Specify file input, otherwise use last argument as input file. If no input file 37 | is specified, read from stdin. 38 | .TP 39 | .BI \-t,\ \-\-tokens 40 | Output a token stream instead of html. 41 | .TP 42 | .BI \-\-pedantic 43 | Conform to obscure parts of markdown.pl as much as possible. Don't fix original 44 | markdown bugs. 45 | .TP 46 | .BI \-\-gfm 47 | Enable github flavored markdown. 48 | .TP 49 | .BI \-\-breaks 50 | Enable GFM line breaks. Only works with the gfm option. 51 | .TP 52 | .BI \-\-tables 53 | Enable GFM tables. Only works with the gfm option. 54 | .TP 55 | .BI \-\-sanitize 56 | Sanitize output. Ignore any HTML input. 57 | .TP 58 | .BI \-\-smart\-lists 59 | Use smarter list behavior than the original markdown. 60 | .TP 61 | .BI \-\-lang\-prefix\ [\fIprefix\fP] 62 | Set the prefix for code block classes. 63 | .TP 64 | .BI \-\-no\-sanitize,\ \-no-etc... 65 | The inverse of any of the marked options above. 66 | .TP 67 | .BI \-\-silent 68 | Silence error output. 69 | .TP 70 | .BI \-h,\ \-\-help 71 | Display help information. 72 | 73 | .SH CONFIGURATION 74 | For configuring and running programmatically. 75 | 76 | .B Example 77 | 78 | require('marked')('*foo*', { gfm: true }); 79 | 80 | .SH BUGS 81 | Please report any bugs to https://github.com/chjj/marked. 82 | 83 | .SH LICENSE 84 | Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). 85 | 86 | .SH "SEE ALSO" 87 | .BR markdown(1), 88 | .BR node.js(1) 89 | -------------------------------------------------------------------------------- /app/bower_components/marked/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "marked", 3 | "description": "A markdown parser built for speed", 4 | "author": "Christopher Jeffrey", 5 | "version": "0.3.2", 6 | "main": "./lib/marked.js", 7 | "bin": "./bin/marked", 8 | "man": "./man/marked.1", 9 | "preferGlobal": true, 10 | "repository": "git://github.com/chjj/marked.git", 11 | "homepage": "https://github.com/chjj/marked", 12 | "bugs": { "url": "http://github.com/chjj/marked/issues" }, 13 | "license": "MIT", 14 | "keywords": ["markdown", "markup", "html"], 15 | "tags": ["markdown", "markup", "html"], 16 | "devDependencies": { 17 | "markdown": "*", 18 | "showdown": "*", 19 | "robotskirt": "*" 20 | }, 21 | "scripts": { "test": "node test", "bench": "node test --bench" } 22 | } 23 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/README: -------------------------------------------------------------------------------- 1 | In this directory: 2 | 3 | # 4 | # MarkdownTester -- Run tests for Markdown implementations 5 | # 6 | # Copyright (c) 2004-2005 John Gruber 7 | # 8 | # 9 | 10 | Partially modified for testing purposes. 11 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/browser/index.html: -------------------------------------------------------------------------------- 1 | 2 | marked tests 3 |

testing...

4 | 5 | 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/browser/index.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | 3 | var test = require('../') 4 | , runTests = test.runTests 5 | , load = test.load; 6 | 7 | var express = require('express') 8 | , app = express(); 9 | 10 | app.use(function(req, res, next) { 11 | var setHeader = res.setHeader; 12 | res.setHeader = function(name) { 13 | switch (name) { 14 | case 'Cache-Control': 15 | case 'Last-Modified': 16 | case 'ETag': 17 | return; 18 | } 19 | return setHeader.apply(res, arguments); 20 | }; 21 | next(); 22 | }); 23 | 24 | var dir = __dirname + '/../tests' 25 | , files = {}; 26 | 27 | app.get('/test.js', function(req, res, next) { 28 | var test = fs.readFileSync(__dirname + '/test.js', 'utf8') 29 | , files = load(); 30 | 31 | test = test.replace('__TESTS__', JSON.stringify(files)); 32 | test = test.replace('__MAIN__', runTests + ''); 33 | 34 | res.contentType('.js'); 35 | res.send(test); 36 | }); 37 | 38 | app.use(express.static(__dirname + '/../../lib')); 39 | app.use(express.static(__dirname)); 40 | 41 | app.listen(8080); 42 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/browser/test.js: -------------------------------------------------------------------------------- 1 | ;(function() { 2 | 3 | var console = {} 4 | , files = __TESTS__; 5 | 6 | console.log = function(text) { 7 | var args = Array.prototype.slice.call(arguments, 1) 8 | , i = 0; 9 | 10 | text = text.replace(/%\w/g, function() { 11 | return args[i++] || ''; 12 | }); 13 | 14 | if (window.console) window.console.log(text); 15 | document.body.innerHTML += '
' + escape(text) + '
'; 16 | }; 17 | 18 | if (!Object.keys) { 19 | Object.keys = function(obj) { 20 | var out = [] 21 | , key; 22 | 23 | for (key in obj) { 24 | if (Object.prototype.hasOwnProperty.call(obj, key)) { 25 | out.push(key); 26 | } 27 | } 28 | 29 | return out; 30 | }; 31 | } 32 | 33 | if (!Array.prototype.forEach) { 34 | Array.prototype.forEach = function(callback, context) { 35 | for (var i = 0; i < this.length; i++) { 36 | callback.call(context || null, this[i], i, obj); 37 | } 38 | }; 39 | } 40 | 41 | if (!String.prototype.trim) { 42 | String.prototype.trim = function() { 43 | return this.replace(/^\s+|\s+$/g, ''); 44 | }; 45 | } 46 | 47 | function load() { 48 | return files; 49 | } 50 | 51 | function escape(html, encode) { 52 | return html 53 | .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') 54 | .replace(//g, '>') 56 | .replace(/"/g, '"') 57 | .replace(/'/g, '''); 58 | } 59 | 60 | (__MAIN__)(); 61 | 62 | }).call(this); 63 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/autolink_lines.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | http://example.com 3 |

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/autolink_lines.text: -------------------------------------------------------------------------------- 1 | hello world 2 | 3 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/blockquote_list_item.html: -------------------------------------------------------------------------------- 1 |

This fails in markdown.pl and upskirt:

2 | 3 |
  • hello

    world

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/blockquote_list_item.text: -------------------------------------------------------------------------------- 1 | This fails in markdown.pl and upskirt: 2 | 3 | * hello 4 | > world 5 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/case_insensitive_refs.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/case_insensitive_refs.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [HI]: /url 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/def_blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

hello 3 | [1]: hello

4 |
5 | 6 |
7 | 8 |
9 |

hello

10 |
11 | 12 | 13 |
    14 |
  • hello
  • 15 |
  • [3]: hello
  • 16 |
17 | 18 | 19 |
    20 |
  • hello
  • 21 |
22 | 23 | 24 |
25 |

foo 26 | bar 27 | bar

28 |
29 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/def_blocks.text: -------------------------------------------------------------------------------- 1 | > hello 2 | > [1]: hello 3 | 4 | * * * 5 | 6 | > hello 7 | [2]: hello 8 | 9 | 10 | * hello 11 | * [3]: hello 12 | 13 | 14 | * hello 15 | [4]: hello 16 | 17 | 18 | > foo 19 | > bar 20 | [1]: foo 21 | > bar 22 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/double_link.html: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 |

Already linked: http://example.com/.

4 | 5 |

Already linked: http://example.com/.

6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/double_link.text: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 | Already linked: [http://example.com/](http://example.com/). 4 | 5 | Already linked: **http://example.com/**. 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/escaped_angles.html: -------------------------------------------------------------------------------- 1 |

>

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/escaped_angles.text: -------------------------------------------------------------------------------- 1 | \> 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_break.breaks.html: -------------------------------------------------------------------------------- 1 |

Look at the
pretty line
breaks.

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_break.breaks.text: -------------------------------------------------------------------------------- 1 | Look at the 2 | pretty line 3 | breaks. 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_code.html: -------------------------------------------------------------------------------- 1 |
var a = 'hello';
2 | console.log(a + ' world');
3 |
echo "hello, ${WORLD}"
4 |
Q: What do you call a tall person who sells stolen goods?
5 |
A longfence!
6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_code.text: -------------------------------------------------------------------------------- 1 | ``` js 2 | var a = 'hello'; 3 | console.log(a + ' world'); 4 | ``` 5 | 6 | ~~~bash 7 | echo "hello, ${WORLD}" 8 | ~~~ 9 | 10 | ```````longfence 11 | Q: What do you call a tall person who sells stolen goods? 12 | ``````` 13 | 14 | ~~~~~~~~~~ ManyTildes 15 | A longfence! 16 | ~~~~~~~~~~ 17 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_code_hr_list.html: -------------------------------------------------------------------------------- 1 |

foo

2 |
    3 |
  1. bar:

    4 |
    5 |
      6 |
    • one
        7 |
      • two
          8 |
        • three
        • 9 |
        • four
        • 10 |
        • five
        • 11 |
        12 |
      • 13 |
      14 |
    • 15 |
    16 |
    17 |
  2. 18 |
  3. foo:

    19 |
     line 1
    20 |  line 2
    21 |
  4. 22 |
  5. foo:

    23 |
      24 |
    1. foo bar bar:

      25 |
       some code here
      26 | 
      27 |
    2. 28 |
    3. foo bar bar:

      29 |
       foo
      30 |  ---
      31 |  bar
      32 |  ---
      33 |  foo
      34 |  bar
      35 |
    4. 36 |
    5. foo bar bar:

      37 |
       ---
      38 |  foo
      39 |  foo
      40 |  ---
      41 |  bar
      42 |
    6. 43 |
    7. foo bar bar:

      44 |
       foo
      45 |  ---
      46 |  bar
      47 |
    8. 48 |
    9. foo

      49 |
    10. 50 |
    51 |
  6. 52 |
53 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_code_hr_list.text: -------------------------------------------------------------------------------- 1 | ## foo 2 | 3 | 1. bar: 4 | 5 | > - one 6 | - two 7 | - three 8 | - four 9 | - five 10 | 11 | 1. foo: 12 | 13 | ``` 14 | line 1 15 | line 2 16 | ``` 17 | 18 | 1. foo: 19 | 20 | 1. foo `bar` bar: 21 | 22 | ``` erb 23 | some code here 24 | ``` 25 | 26 | 2. foo `bar` bar: 27 | 28 | ``` erb 29 | foo 30 | --- 31 | bar 32 | --- 33 | foo 34 | bar 35 | ``` 36 | 37 | 3. foo `bar` bar: 38 | 39 | ``` html 40 | --- 41 | foo 42 | foo 43 | --- 44 | bar 45 | ``` 46 | 47 | 4. foo `bar` bar: 48 | 49 | foo 50 | --- 51 | bar 52 | 53 | 5. foo 54 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_del.html: -------------------------------------------------------------------------------- 1 |

hello hi world

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_del.text: -------------------------------------------------------------------------------- 1 | hello ~~hi~~ world 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_em.html: -------------------------------------------------------------------------------- 1 |

These words should_not_be_emphasized.

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_em.text: -------------------------------------------------------------------------------- 1 | These words should_not_be_emphasized. 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_links.html: -------------------------------------------------------------------------------- 1 |

This should be a link: 2 | http://example.com/hello-world.

3 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_links.text: -------------------------------------------------------------------------------- 1 | This should be a link: http://example.com/hello-world. 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_tables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Heading 1Heading 2
Cell 1Cell 2
Cell 3Cell 4
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
19 |
Test code
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
38 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/gfm_tables.text: -------------------------------------------------------------------------------- 1 | | Heading 1 | Heading 2 2 | | --------- | --------- 3 | | Cell 1 | Cell 2 4 | | Cell 3 | Cell 4 5 | 6 | | Header 1 | Header 2 | Header 3 | Header 4 | 7 | | :------: | -------: | :------- | -------- | 8 | | Cell 1 | Cell 2 | Cell 3 | Cell 4 | 9 | | Cell 5 | Cell 6 | Cell 7 | Cell 8 | 10 | 11 | Test code 12 | 13 | Header 1 | Header 2 14 | -------- | -------- 15 | Cell 1 | Cell 2 16 | Cell 3 | Cell 4 17 | 18 | Header 1|Header 2|Header 3|Header 4 19 | :-------|:------:|-------:|-------- 20 | Cell 1 |Cell 2 |Cell 3 |Cell 4 21 | *Cell 5*|Cell 6 |Cell 7 |Cell 8 22 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/hr_list_break.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world
  • 4 |
  • how 5 | are
  • 6 |
7 | 8 |
9 | 10 |

you today?

11 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/hr_list_break.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | * how 4 | are 5 | * * * 6 | you today? 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/lazy_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

hi there 3 | bud

4 |
5 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/lazy_blockquotes.text: -------------------------------------------------------------------------------- 1 | > hi there 2 | bud 3 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/list_item_text.html: -------------------------------------------------------------------------------- 1 |
  • item1

    • item2

    text

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/list_item_text.text: -------------------------------------------------------------------------------- 1 | * item1 2 | 3 | * item2 4 | 5 | text 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/loose_lists.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world

    4 | 5 |

    how 6 | are

  • 7 |
  • you
  • 8 |
9 | 10 | 11 | 12 |

better behavior:

13 | 14 |
  • hello

    • world 15 | how

      are 16 | you

    • today

  • hi
17 | 18 | 19 | 20 |
    21 |
  • hello

  • 22 |
  • world

  • 23 |
  • hi
  • 24 |
25 | 26 | 27 | 28 |
    29 |
  • hello
  • 30 |
  • world

  • 31 |
  • hi

  • 32 |
33 | 34 | 35 | 36 |
    37 |
  • hello
  • 38 |
  • world

    39 | 40 |

    how

  • 41 |
  • hi
  • 42 |
43 | 44 | 45 | 46 |
    47 |
  • hello
  • 48 |
  • world
  • 49 |
  • how

    50 | 51 |

    are

  • 52 |
53 | 54 | 55 | 56 |
    57 |
  • hello
  • 58 |
  • world

  • 59 |
  • how

    60 | 61 |

    are

  • 62 |
63 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/loose_lists.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | 4 | how 5 | are 6 | * you 7 | 8 | 9 | 10 | better behavior: 11 | 12 | * hello 13 | * world 14 | how 15 | 16 | are 17 | you 18 | 19 | * today 20 | * hi 21 | 22 | 23 | 24 | * hello 25 | 26 | * world 27 | * hi 28 | 29 | 30 | 31 | * hello 32 | * world 33 | 34 | * hi 35 | 36 | 37 | 38 | * hello 39 | * world 40 | 41 | how 42 | * hi 43 | 44 | 45 | 46 | * hello 47 | * world 48 | * how 49 | 50 | are 51 | 52 | 53 | 54 | * hello 55 | * world 56 | 57 | * how 58 | 59 | are 60 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/main.html: -------------------------------------------------------------------------------- 1 |

A heading

Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.

A link. Not anymore.

  • List Item 1

  • List Item 2

    • New List Item 1 Hi, this is a list item.
    • New List Item 2 Another item
      Code goes here.
      3 | Lots of it...
    • New List Item 3 The last item
  • List Item 3 The final item.

  • List Item 4 The real final item.

Paragraph.

  • bq Item 1
  • bq Item 2
    • New bq Item 1
    • New bq Item 2 Text here

Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again

Another Heading

Hello world. Here is a link. And an image alt.

Code goes here.
4 | Lots of it...
5 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/main.text: -------------------------------------------------------------------------------- 1 | [test]: http://google.com/ "Google" 2 | 3 | # A heading 4 | 5 | Just a note, I've found that I can't test my markdown parser vs others. 6 | For example, both markdown.js and showdown code blocks in lists wrong. They're 7 | also completely [inconsistent][test] with regards to paragraphs in list items. 8 | 9 | A link. Not anymore. 10 | 11 | 13 | 14 | * List Item 1 15 | 16 | * List Item 2 17 | * New List Item 1 18 | Hi, this is a list item. 19 | * New List Item 2 20 | Another item 21 | Code goes here. 22 | Lots of it... 23 | * New List Item 3 24 | The last item 25 | 26 | * List Item 3 27 | The final item. 28 | 29 | * List Item 4 30 | The real final item. 31 | 32 | Paragraph. 33 | 34 | > * bq Item 1 35 | > * bq Item 2 36 | > * New bq Item 1 37 | > * New bq Item 2 38 | > Text here 39 | 40 | * * * 41 | 42 | > Another blockquote! 43 | > I really need to get 44 | > more creative with 45 | > mockup text.. 46 | > markdown.js breaks here again 47 | 48 | Another Heading 49 | ------------- 50 | 51 | Hello *world*. Here is a [link](//hello). 52 | And an image ![alt](src). 53 | 54 | Code goes here. 55 | Lots of it... 56 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/nested_code.html: -------------------------------------------------------------------------------- 1 |

hi ther `` ok ```

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/nested_code.text: -------------------------------------------------------------------------------- 1 | ````` hi ther `` ok ``` ````` 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/nested_em.html: -------------------------------------------------------------------------------- 1 |

test test test

2 | 3 |

test test test

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/nested_em.text: -------------------------------------------------------------------------------- 1 | *test **test** test* 2 | 3 | _test __test__ test_ 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/nested_square_link.html: -------------------------------------------------------------------------------- 1 |

the ] character

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/nested_square_link.text: -------------------------------------------------------------------------------- 1 | [the `]` character](/url) 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/not_a_link.html: -------------------------------------------------------------------------------- 1 |

[test](not a link)

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/not_a_link.text: -------------------------------------------------------------------------------- 1 | \[test](not a link) 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/ref_paren.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/ref_paren.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [hi]: /url (there) 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/same_bullet.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • test
  • 3 |
  • test
  • 4 |
  • test
  • 5 |
6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/same_bullet.text: -------------------------------------------------------------------------------- 1 | * test 2 | + test 3 | - test 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/text.smartypants.html: -------------------------------------------------------------------------------- 1 |

Hello world ‘how’ “are” you — today…

2 | 3 |

“It’s a more ‘challenging’ smartypants test…”

4 | 5 |

‘And,’ as a bonus — “one 6 | multiline” test!

7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/text.smartypants.text: -------------------------------------------------------------------------------- 1 | Hello world 'how' "are" you -- today... 2 | 3 | "It's a more 'challenging' smartypants test..." 4 | 5 | 'And,' as a bonus -- "one 6 | multiline" test! 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/toplevel_paragraphs.gfm.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | how are you 3 | how are you

4 | 5 |

hello world

6 |
how are you
7 | 8 |

hello world

9 |
10 | 11 |

hello world

12 |

how are you

13 | 14 |

hello world

15 |

how are you

16 | 17 |

hello world

18 |

how are you

19 | 20 |

hello world

21 |
  • how are you
22 | 23 |

hello world

24 |
how are you
25 | 26 |

hello world 27 | how are you

28 | 29 |

hello world 30 |

31 | 32 |
hello
33 | 34 |

hello

35 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/toplevel_paragraphs.gfm.text: -------------------------------------------------------------------------------- 1 | hello world 2 | how are you 3 | how are you 4 | 5 | hello world 6 | ``` 7 | how are you 8 | ``` 9 | 10 | hello world 11 | * * * 12 | 13 | hello world 14 | # how are you 15 | 16 | hello world 17 | how are you 18 | =========== 19 | 20 | hello world 21 | > how are you 22 | 23 | hello world 24 | * how are you 25 | 26 | hello world 27 |
how are you
28 | 29 | hello world 30 | how are you 31 | 32 | hello [world][how] 33 | [how]: /are/you 34 | 35 |
hello
36 | 37 | hello 38 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/tricky_list.html: -------------------------------------------------------------------------------- 1 |

hello world

2 | 3 |
    4 |
  • hello world
  • 5 |
6 | 7 |

hello world

8 | 9 |
    10 |
  • hello world
  • 11 |
12 | 13 |

hello world

14 | 15 |
    16 |
  • Hello world
  • 17 |
18 | 19 |

hello world

20 | 21 |
    22 |
  • hello world
  • 23 |
24 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/new/tricky_list.text: -------------------------------------------------------------------------------- 1 | **hello** _world_ 2 | 3 | * hello world 4 | 5 | **hello** _world_ 6 | 7 | * hello world 8 | 9 | **hello** _world_ 10 | 11 | * Hello world 12 | 13 | **hello** _world_ 14 | 15 | * hello world 16 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/amps_and_angles_encoding.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/amps_and_angles_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" 22 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/auto_links.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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: 14 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/backslash_escapes.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/blockquotes_with_code_blocks.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/code_blocks.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 15 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/code_spans.html: -------------------------------------------------------------------------------- 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 | 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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. 6 | 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/horizontal_rules.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/inline_html_advanced.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/inline_html_comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

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

Paragraph two.

10 | 11 | 12 | 13 |

The end.

14 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/inline_html_comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/links_inline_style.html: -------------------------------------------------------------------------------- 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 and title.

12 | 13 |

URL and title.

14 | 15 |

Empty.

16 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 and title]( /url/has space ). 12 | 13 | [URL and title]( /url/has space/ "url has space and title"). 14 | 15 | [Empty](). 16 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/links_reference_style.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/links_shortcut_references.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/literal_quotes_in_titles.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/nested_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

foo

3 | 4 |
5 |

bar

6 |
7 | 8 |

foo

9 |
10 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/nested_blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/ordered_and_unordered_lists.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/strong_and_em_together.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/tabs.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/tidyness.html: -------------------------------------------------------------------------------- 1 |
2 |

A list within a blockquote:

3 |
    4 |
  • asterisk 1
  • 5 |
  • asterisk 2
  • 6 |
  • asterisk 3
  • 7 |
8 |
9 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/original/tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/amps_and_angles_encoding.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/amps_and_angles_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" 22 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/auto_links.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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: 14 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/autolink_lines.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | http://example.com 3 |

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/autolink_lines.text: -------------------------------------------------------------------------------- 1 | hello world 2 | 3 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/backslash_escapes.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/blockquote_list_item.html: -------------------------------------------------------------------------------- 1 |

This fails in markdown.pl and upskirt:

2 | 3 |
  • hello

    world

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/blockquote_list_item.text: -------------------------------------------------------------------------------- 1 | This fails in markdown.pl and upskirt: 2 | 3 | * hello 4 | > world 5 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/blockquotes_with_code_blocks.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/case_insensitive_refs.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/case_insensitive_refs.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [HI]: /url 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/code_blocks.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 15 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/code_spans.html: -------------------------------------------------------------------------------- 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 | 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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. 6 | 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/def_blocks.html: -------------------------------------------------------------------------------- 1 |
2 |

hello 3 | [1]: hello

4 |
5 | 6 |
7 | 8 |
9 |

hello

10 |
11 | 12 | 13 |
    14 |
  • hello
  • 15 |
  • [3]: hello
  • 16 |
17 | 18 | 19 |
    20 |
  • hello
  • 21 |
22 | 23 | 24 |
25 |

foo 26 | bar 27 | bar

28 |
29 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/def_blocks.text: -------------------------------------------------------------------------------- 1 | > hello 2 | > [1]: hello 3 | 4 | * * * 5 | 6 | > hello 7 | [2]: hello 8 | 9 | 10 | * hello 11 | * [3]: hello 12 | 13 | 14 | * hello 15 | [4]: hello 16 | 17 | 18 | > foo 19 | > bar 20 | [1]: foo 21 | > bar 22 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/double_link.html: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 |

Already linked: http://example.com/.

4 | 5 |

Already linked: http://example.com/.

6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/double_link.text: -------------------------------------------------------------------------------- 1 |

Already linked: http://example.com/.

2 | 3 | Already linked: [http://example.com/](http://example.com/). 4 | 5 | Already linked: **http://example.com/**. 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/escaped_angles.html: -------------------------------------------------------------------------------- 1 |

>

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/escaped_angles.text: -------------------------------------------------------------------------------- 1 | \> 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_break.breaks.html: -------------------------------------------------------------------------------- 1 |

Look at the
pretty line
breaks.

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_break.breaks.text: -------------------------------------------------------------------------------- 1 | Look at the 2 | pretty line 3 | breaks. 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_code.html: -------------------------------------------------------------------------------- 1 |
var a = 'hello';
2 | console.log(a + ' world');
3 |
echo "hello, ${WORLD}"
4 |
Q: What do you call a tall person who sells stolen goods?
5 |
A longfence!
6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_code.text: -------------------------------------------------------------------------------- 1 | ``` js 2 | var a = 'hello'; 3 | console.log(a + ' world'); 4 | ``` 5 | 6 | ~~~bash 7 | echo "hello, ${WORLD}" 8 | ~~~ 9 | 10 | ```````longfence 11 | Q: What do you call a tall person who sells stolen goods? 12 | ``````` 13 | 14 | ~~~~~~~~~~ ManyTildes 15 | A longfence! 16 | ~~~~~~~~~~ 17 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_code_hr_list.html: -------------------------------------------------------------------------------- 1 |

foo

2 |
    3 |
  1. bar:

    4 |
    5 |
      6 |
    • one
        7 |
      • two
          8 |
        • three
        • 9 |
        • four
        • 10 |
        • five
        • 11 |
        12 |
      • 13 |
      14 |
    • 15 |
    16 |
    17 |
  2. 18 |
  3. foo:

    19 |
     line 1
    20 |  line 2
    21 |
  4. 22 |
  5. foo:

    23 |
      24 |
    1. foo bar bar:

      25 |
       some code here
      26 | 
      27 |
    2. 28 |
    3. foo bar bar:

      29 |
       foo
      30 |  ---
      31 |  bar
      32 |  ---
      33 |  foo
      34 |  bar
      35 |
    4. 36 |
    5. foo bar bar:

      37 |
       ---
      38 |  foo
      39 |  foo
      40 |  ---
      41 |  bar
      42 |
    6. 43 |
    7. foo bar bar:

      44 |
       foo
      45 |  ---
      46 |  bar
      47 |
    8. 48 |
    9. foo

      49 |
    10. 50 |
    51 |
  6. 52 |
53 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_code_hr_list.text: -------------------------------------------------------------------------------- 1 | ## foo 2 | 3 | 1. bar: 4 | 5 | > - one 6 | - two 7 | - three 8 | - four 9 | - five 10 | 11 | 1. foo: 12 | 13 | ``` 14 | line 1 15 | line 2 16 | ``` 17 | 18 | 1. foo: 19 | 20 | 1. foo `bar` bar: 21 | 22 | ``` erb 23 | some code here 24 | ``` 25 | 26 | 2. foo `bar` bar: 27 | 28 | ``` erb 29 | foo 30 | --- 31 | bar 32 | --- 33 | foo 34 | bar 35 | ``` 36 | 37 | 3. foo `bar` bar: 38 | 39 | ``` html 40 | --- 41 | foo 42 | foo 43 | --- 44 | bar 45 | ``` 46 | 47 | 4. foo `bar` bar: 48 | 49 | foo 50 | --- 51 | bar 52 | 53 | 5. foo 54 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_del.html: -------------------------------------------------------------------------------- 1 |

hello hi world

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_del.text: -------------------------------------------------------------------------------- 1 | hello ~~hi~~ world 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_em.html: -------------------------------------------------------------------------------- 1 |

These words should_not_be_emphasized.

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_em.text: -------------------------------------------------------------------------------- 1 | These words should_not_be_emphasized. 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_links.html: -------------------------------------------------------------------------------- 1 |

This should be a link: 2 | http://example.com/hello-world.

3 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_links.text: -------------------------------------------------------------------------------- 1 | This should be a link: http://example.com/hello-world. 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_tables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Heading 1Heading 2
Cell 1Cell 2
Cell 3Cell 4
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
19 |
Test code
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Header 1Header 2
Cell 1Cell 2
Cell 3Cell 4
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
Header 1Header 2Header 3Header 4
Cell 1Cell 2Cell 3Cell 4
Cell 5Cell 6Cell 7Cell 8
38 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/gfm_tables.text: -------------------------------------------------------------------------------- 1 | | Heading 1 | Heading 2 2 | | --------- | --------- 3 | | Cell 1 | Cell 2 4 | | Cell 3 | Cell 4 5 | 6 | | Header 1 | Header 2 | Header 3 | Header 4 | 7 | | :------: | -------: | :------- | -------- | 8 | | Cell 1 | Cell 2 | Cell 3 | Cell 4 | 9 | | Cell 5 | Cell 6 | Cell 7 | Cell 8 | 10 | 11 | Test code 12 | 13 | Header 1 | Header 2 14 | -------- | -------- 15 | Cell 1 | Cell 2 16 | Cell 3 | Cell 4 17 | 18 | Header 1|Header 2|Header 3|Header 4 19 | :-------|:------:|-------:|-------- 20 | Cell 1 |Cell 2 |Cell 3 |Cell 4 21 | *Cell 5*|Cell 6 |Cell 7 |Cell 8 22 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/horizontal_rules.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/hr_list_break.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world
  • 4 |
  • how 5 | are
  • 6 |
7 | 8 |
9 | 10 |

you today?

11 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/hr_list_break.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | * how 4 | are 5 | * * * 6 | you today? 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/inline_html_advanced.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/inline_html_comments.html: -------------------------------------------------------------------------------- 1 |

Paragraph one.

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

Paragraph two.

10 | 11 | 12 | 13 |

The end.

14 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/inline_html_comments.text: -------------------------------------------------------------------------------- 1 | Paragraph one. 2 | 3 | 4 | 5 | 8 | 9 | Paragraph two. 10 | 11 | 12 | 13 | The end. 14 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/lazy_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

hi there 3 | bud

4 |
5 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/lazy_blockquotes.text: -------------------------------------------------------------------------------- 1 | > hi there 2 | bud 3 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/links_inline_style.html: -------------------------------------------------------------------------------- 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 and title.

12 | 13 |

URL and title.

14 | 15 |

Empty.

16 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 and title]( /url/has space ). 12 | 13 | [URL and title]( /url/has space/ "url has space and title"). 14 | 15 | [Empty](). 16 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/links_reference_style.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/links_shortcut_references.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/list_item_text.html: -------------------------------------------------------------------------------- 1 |
  • item1

    • item2

    text

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/list_item_text.text: -------------------------------------------------------------------------------- 1 | * item1 2 | 3 | * item2 4 | 5 | text 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/literal_quotes_in_titles.html: -------------------------------------------------------------------------------- 1 |

Foo bar.

2 | 3 |

Foo bar.

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/loose_lists.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • hello 3 | world

    4 | 5 |

    how 6 | are

  • 7 |
  • you
  • 8 |
9 | 10 | 11 | 12 |

better behavior:

13 | 14 |
  • hello

    • world 15 | how

      are 16 | you

    • today

  • hi
17 | 18 | 19 | 20 |
    21 |
  • hello

  • 22 |
  • world

  • 23 |
  • hi
  • 24 |
25 | 26 | 27 | 28 |
    29 |
  • hello
  • 30 |
  • world

  • 31 |
  • hi

  • 32 |
33 | 34 | 35 | 36 |
    37 |
  • hello
  • 38 |
  • world

    39 | 40 |

    how

  • 41 |
  • hi
  • 42 |
43 | 44 | 45 | 46 |
    47 |
  • hello
  • 48 |
  • world
  • 49 |
  • how

    50 | 51 |

    are

  • 52 |
53 | 54 | 55 | 56 |
    57 |
  • hello
  • 58 |
  • world

  • 59 |
  • how

    60 | 61 |

    are

  • 62 |
63 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/loose_lists.text: -------------------------------------------------------------------------------- 1 | * hello 2 | world 3 | 4 | how 5 | are 6 | * you 7 | 8 | 9 | 10 | better behavior: 11 | 12 | * hello 13 | * world 14 | how 15 | 16 | are 17 | you 18 | 19 | * today 20 | * hi 21 | 22 | 23 | 24 | * hello 25 | 26 | * world 27 | * hi 28 | 29 | 30 | 31 | * hello 32 | * world 33 | 34 | * hi 35 | 36 | 37 | 38 | * hello 39 | * world 40 | 41 | how 42 | * hi 43 | 44 | 45 | 46 | * hello 47 | * world 48 | * how 49 | 50 | are 51 | 52 | 53 | 54 | * hello 55 | * world 56 | 57 | * how 58 | 59 | are 60 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/main.html: -------------------------------------------------------------------------------- 1 |

A heading

Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.

A link. Not anymore.

  • List Item 1

  • List Item 2

    • New List Item 1 Hi, this is a list item.
    • New List Item 2 Another item
      Code goes here.
      3 | Lots of it...
    • New List Item 3 The last item
  • List Item 3 The final item.

  • List Item 4 The real final item.

Paragraph.

  • bq Item 1
  • bq Item 2
    • New bq Item 1
    • New bq Item 2 Text here

Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again

Another Heading

Hello world. Here is a link. And an image alt.

Code goes here.
4 | Lots of it...
5 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/main.text: -------------------------------------------------------------------------------- 1 | [test]: http://google.com/ "Google" 2 | 3 | # A heading 4 | 5 | Just a note, I've found that I can't test my markdown parser vs others. 6 | For example, both markdown.js and showdown code blocks in lists wrong. They're 7 | also completely [inconsistent][test] with regards to paragraphs in list items. 8 | 9 | A link. Not anymore. 10 | 11 | 13 | 14 | * List Item 1 15 | 16 | * List Item 2 17 | * New List Item 1 18 | Hi, this is a list item. 19 | * New List Item 2 20 | Another item 21 | Code goes here. 22 | Lots of it... 23 | * New List Item 3 24 | The last item 25 | 26 | * List Item 3 27 | The final item. 28 | 29 | * List Item 4 30 | The real final item. 31 | 32 | Paragraph. 33 | 34 | > * bq Item 1 35 | > * bq Item 2 36 | > * New bq Item 1 37 | > * New bq Item 2 38 | > Text here 39 | 40 | * * * 41 | 42 | > Another blockquote! 43 | > I really need to get 44 | > more creative with 45 | > mockup text.. 46 | > markdown.js breaks here again 47 | 48 | Another Heading 49 | ------------- 50 | 51 | Hello *world*. Here is a [link](//hello). 52 | And an image ![alt](src). 53 | 54 | Code goes here. 55 | Lots of it... 56 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_blockquotes.html: -------------------------------------------------------------------------------- 1 |
2 |

foo

3 | 4 |
5 |

bar

6 |
7 | 8 |

foo

9 |
10 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_blockquotes.text: -------------------------------------------------------------------------------- 1 | > foo 2 | > 3 | > > bar 4 | > 5 | > foo 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_code.html: -------------------------------------------------------------------------------- 1 |

hi ther `` ok ```

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_code.text: -------------------------------------------------------------------------------- 1 | ````` hi ther `` ok ``` ````` 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_em.html: -------------------------------------------------------------------------------- 1 |

test test test

2 | 3 |

test test test

4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_em.text: -------------------------------------------------------------------------------- 1 | *test **test** test* 2 | 3 | _test __test__ test_ 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_square_link.html: -------------------------------------------------------------------------------- 1 |

the ] character

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/nested_square_link.text: -------------------------------------------------------------------------------- 1 | [the `]` character](/url) 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/not_a_link.html: -------------------------------------------------------------------------------- 1 |

[test](not a link)

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/not_a_link.text: -------------------------------------------------------------------------------- 1 | \[test](not a link) 2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/ordered_and_unordered_lists.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/ref_paren.html: -------------------------------------------------------------------------------- 1 |

hi

2 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/ref_paren.text: -------------------------------------------------------------------------------- 1 | [hi] 2 | 3 | [hi]: /url (there) 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/same_bullet.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • test
  • 3 |
  • test
  • 4 |
  • test
  • 5 |
6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/same_bullet.text: -------------------------------------------------------------------------------- 1 | * test 2 | + test 3 | - test 4 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/strong_and_em_together.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/tabs.html: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/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 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/text.smartypants.html: -------------------------------------------------------------------------------- 1 |

Hello world ‘how’ “are” you — today…

2 | 3 |

“It’s a more ‘challenging’ smartypants test…”

4 | 5 |

‘And,’ as a bonus — “one 6 | multiline” test!

7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/text.smartypants.text: -------------------------------------------------------------------------------- 1 | Hello world 'how' "are" you -- today... 2 | 3 | "It's a more 'challenging' smartypants test..." 4 | 5 | 'And,' as a bonus -- "one 6 | multiline" test! 7 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/tidyness.html: -------------------------------------------------------------------------------- 1 |
2 |

A list within a blockquote:

3 |
    4 |
  • asterisk 1
  • 5 |
  • asterisk 2
  • 6 |
  • asterisk 3
  • 7 |
8 |
9 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/tidyness.text: -------------------------------------------------------------------------------- 1 | > A list within a blockquote: 2 | > 3 | > * asterisk 1 4 | > * asterisk 2 5 | > * asterisk 3 6 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.html: -------------------------------------------------------------------------------- 1 |

hello world 2 | how are you 3 | how are you

4 | 5 |

hello world

6 |
how are you
7 | 8 |

hello world

9 |
10 | 11 |

hello world

12 |

how are you

13 | 14 |

hello world

15 |

how are you

16 | 17 |

hello world

18 |

how are you

19 | 20 |

hello world

21 |
  • how are you
22 | 23 |

hello world

24 |
how are you
25 | 26 |

hello world 27 | how are you

28 | 29 |

hello world 30 |

31 | 32 |
hello
33 | 34 |

hello

35 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.text: -------------------------------------------------------------------------------- 1 | hello world 2 | how are you 3 | how are you 4 | 5 | hello world 6 | ``` 7 | how are you 8 | ``` 9 | 10 | hello world 11 | * * * 12 | 13 | hello world 14 | # how are you 15 | 16 | hello world 17 | how are you 18 | =========== 19 | 20 | hello world 21 | > how are you 22 | 23 | hello world 24 | * how are you 25 | 26 | hello world 27 |
how are you
28 | 29 | hello world 30 | how are you 31 | 32 | hello [world][how] 33 | [how]: /are/you 34 | 35 |
hello
36 | 37 | hello 38 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/tricky_list.html: -------------------------------------------------------------------------------- 1 |

hello world

2 | 3 |
    4 |
  • hello world
  • 5 |
6 | 7 |

hello world

8 | 9 |
    10 |
  • hello world
  • 11 |
12 | 13 |

hello world

14 | 15 |
    16 |
  • Hello world
  • 17 |
18 | 19 |

hello world

20 | 21 |
    22 |
  • hello world
  • 23 |
24 | -------------------------------------------------------------------------------- /app/bower_components/marked/test/tests/tricky_list.text: -------------------------------------------------------------------------------- 1 | **hello** _world_ 2 | 3 | * hello world 4 | 5 | **hello** _world_ 6 | 7 | * hello world 8 | 9 | **hello** _world_ 10 | 11 | * Hello world 12 | 13 | **hello** _world_ 14 | 15 | * hello world 16 | -------------------------------------------------------------------------------- /app/bower_components/normalize-css/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "normalize-css", 3 | "version": "3.0.1", 4 | "main": "normalize.css", 5 | "author": "Nicolas Gallagher", 6 | "ignore": [ 7 | "CHANGELOG.md", 8 | "CONTRIBUTING.md", 9 | "component.json", 10 | "package.json", 11 | "test.html" 12 | ], 13 | "homepage": "https://github.com/necolas/normalize.css", 14 | "_release": "3.0.1", 15 | "_resolution": { 16 | "type": "version", 17 | "tag": "3.0.1", 18 | "commit": "e3c71c911b0c0ebc0ee14d2421543ce1476fd761" 19 | }, 20 | "_source": "git://github.com/necolas/normalize.css.git", 21 | "_target": "~3.0.1", 22 | "_originalSource": "normalize-css", 23 | "_direct": true 24 | } -------------------------------------------------------------------------------- /app/bower_components/normalize-css/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) Nicolas Gallagher and Jonathan Neal 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/bower_components/normalize-css/README.md: -------------------------------------------------------------------------------- 1 | # normalize.css v3 2 | 3 | Normalize.css is a customisable CSS file that makes browsers render all 4 | elements more consistently and in line with modern standards. 5 | 6 | The project relies on researching the differences between default browser 7 | styles in order to precisely target only the styles that need or benefit from 8 | normalizing. 9 | 10 | [View the test file](http://necolas.github.io/normalize.css/latest/test.html) 11 | 12 | ## Install 13 | 14 | Download from the [project page](http://necolas.github.io/normalize.css/). 15 | 16 | Install with [Component(1)](https://github.com/component/component/): `component install necolas/normalize.css` 17 | 18 | Install with [npm](http://npmjs.org/): `npm install --save normalize.css` 19 | 20 | Install with [Bower](http://bower.io/): `bower install --save normalize.css` 21 | 22 | ## What does it do? 23 | 24 | * Preserves useful defaults, unlike many CSS resets. 25 | * Normalizes styles for a wide range of elements. 26 | * Corrects bugs and common browser inconsistencies. 27 | * Improves usability with subtle improvements. 28 | * Explains what code does using detailed comments. 29 | 30 | ## How to use it 31 | 32 | No other styles should come before Normalize.css. 33 | 34 | It is recommended that you include the `normalize.css` file as untouched 35 | library code. 36 | 37 | ## Browser support 38 | 39 | * Google Chrome (latest) 40 | * Mozilla Firefox (latest) 41 | * Mozilla Firefox 4 42 | * Opera (latest) 43 | * Apple Safari 6+ 44 | * Internet Explorer 8+ 45 | 46 | [Normalize.css v1 provides legacy browser 47 | support](https://github.com/necolas/normalize.css/tree/v1) (IE 6+, Safari 4+), 48 | but is no longer actively developed. 49 | 50 | ## Contributing 51 | 52 | Please read the CONTRIBUTING.md 53 | 54 | ## Acknowledgements 55 | 56 | Normalize.css is a project by [Nicolas Gallagher](https://github.com/necolas), 57 | co-created with [Jonathan Neal](https://github.com/jonathantneal). 58 | -------------------------------------------------------------------------------- /app/bower_components/normalize-css/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "normalize-css", 3 | "version": "3.0.1", 4 | "main": "normalize.css", 5 | "author": "Nicolas Gallagher", 6 | "ignore": [ 7 | "CHANGELOG.md", 8 | "CONTRIBUTING.md", 9 | "component.json", 10 | "package.json", 11 | "test.html" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /app/bower_components/normalize-css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.1 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined for any HTML5 element in IE 8/9. 28 | * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. 29 | * Correct `block` display not defined for `main` in IE 11. 30 | */ 31 | 32 | article, 33 | aside, 34 | details, 35 | figcaption, 36 | figure, 37 | footer, 38 | header, 39 | hgroup, 40 | main, 41 | nav, 42 | section, 43 | summary { 44 | display: block; 45 | } 46 | 47 | /** 48 | * 1. Correct `inline-block` display not defined in IE 8/9. 49 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 50 | */ 51 | 52 | audio, 53 | canvas, 54 | progress, 55 | video { 56 | display: inline-block; /* 1 */ 57 | vertical-align: baseline; /* 2 */ 58 | } 59 | 60 | /** 61 | * Prevent modern browsers from displaying `audio` without controls. 62 | * Remove excess height in iOS 5 devices. 63 | */ 64 | 65 | audio:not([controls]) { 66 | display: none; 67 | height: 0; 68 | } 69 | 70 | /** 71 | * Address `[hidden]` styling not present in IE 8/9/10. 72 | * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. 73 | */ 74 | 75 | [hidden], 76 | template { 77 | display: none; 78 | } 79 | 80 | /* Links 81 | ========================================================================== */ 82 | 83 | /** 84 | * Remove the gray background color from active links in IE 10. 85 | */ 86 | 87 | a { 88 | background: transparent; 89 | } 90 | 91 | /** 92 | * Improve readability when focused and also mouse hovered in all browsers. 93 | */ 94 | 95 | a:active, 96 | a:hover { 97 | outline: 0; 98 | } 99 | 100 | /* Text-level semantics 101 | ========================================================================== */ 102 | 103 | /** 104 | * Address styling not present in IE 8/9/10/11, Safari, and Chrome. 105 | */ 106 | 107 | abbr[title] { 108 | border-bottom: 1px dotted; 109 | } 110 | 111 | /** 112 | * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. 113 | */ 114 | 115 | b, 116 | strong { 117 | font-weight: bold; 118 | } 119 | 120 | /** 121 | * Address styling not present in Safari and Chrome. 122 | */ 123 | 124 | dfn { 125 | font-style: italic; 126 | } 127 | 128 | /** 129 | * Address variable `h1` font-size and margin within `section` and `article` 130 | * contexts in Firefox 4+, Safari, and Chrome. 131 | */ 132 | 133 | h1 { 134 | font-size: 2em; 135 | margin: 0.67em 0; 136 | } 137 | 138 | /** 139 | * Address styling not present in IE 8/9. 140 | */ 141 | 142 | mark { 143 | background: #ff0; 144 | color: #000; 145 | } 146 | 147 | /** 148 | * Address inconsistent and variable font size in all browsers. 149 | */ 150 | 151 | small { 152 | font-size: 80%; 153 | } 154 | 155 | /** 156 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 157 | */ 158 | 159 | sub, 160 | sup { 161 | font-size: 75%; 162 | line-height: 0; 163 | position: relative; 164 | vertical-align: baseline; 165 | } 166 | 167 | sup { 168 | top: -0.5em; 169 | } 170 | 171 | sub { 172 | bottom: -0.25em; 173 | } 174 | 175 | /* Embedded content 176 | ========================================================================== */ 177 | 178 | /** 179 | * Remove border when inside `a` element in IE 8/9/10. 180 | */ 181 | 182 | img { 183 | border: 0; 184 | } 185 | 186 | /** 187 | * Correct overflow not hidden in IE 9/10/11. 188 | */ 189 | 190 | svg:not(:root) { 191 | overflow: hidden; 192 | } 193 | 194 | /* Grouping content 195 | ========================================================================== */ 196 | 197 | /** 198 | * Address margin not present in IE 8/9 and Safari. 199 | */ 200 | 201 | figure { 202 | margin: 1em 40px; 203 | } 204 | 205 | /** 206 | * Address differences between Firefox and other browsers. 207 | */ 208 | 209 | hr { 210 | -moz-box-sizing: content-box; 211 | box-sizing: content-box; 212 | height: 0; 213 | } 214 | 215 | /** 216 | * Contain overflow in all browsers. 217 | */ 218 | 219 | pre { 220 | overflow: auto; 221 | } 222 | 223 | /** 224 | * Address odd `em`-unit font size rendering in all browsers. 225 | */ 226 | 227 | code, 228 | kbd, 229 | pre, 230 | samp { 231 | font-family: monospace, monospace; 232 | font-size: 1em; 233 | } 234 | 235 | /* Forms 236 | ========================================================================== */ 237 | 238 | /** 239 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 240 | * styling of `select`, unless a `border` property is set. 241 | */ 242 | 243 | /** 244 | * 1. Correct color not being inherited. 245 | * Known issue: affects color of disabled elements. 246 | * 2. Correct font properties not being inherited. 247 | * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. 248 | */ 249 | 250 | button, 251 | input, 252 | optgroup, 253 | select, 254 | textarea { 255 | color: inherit; /* 1 */ 256 | font: inherit; /* 2 */ 257 | margin: 0; /* 3 */ 258 | } 259 | 260 | /** 261 | * Address `overflow` set to `hidden` in IE 8/9/10/11. 262 | */ 263 | 264 | button { 265 | overflow: visible; 266 | } 267 | 268 | /** 269 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 270 | * All other form control elements do not inherit `text-transform` values. 271 | * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. 272 | * Correct `select` style inheritance in Firefox. 273 | */ 274 | 275 | button, 276 | select { 277 | text-transform: none; 278 | } 279 | 280 | /** 281 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 282 | * and `video` controls. 283 | * 2. Correct inability to style clickable `input` types in iOS. 284 | * 3. Improve usability and consistency of cursor style between image-type 285 | * `input` and others. 286 | */ 287 | 288 | button, 289 | html input[type="button"], /* 1 */ 290 | input[type="reset"], 291 | input[type="submit"] { 292 | -webkit-appearance: button; /* 2 */ 293 | cursor: pointer; /* 3 */ 294 | } 295 | 296 | /** 297 | * Re-set default cursor for disabled elements. 298 | */ 299 | 300 | button[disabled], 301 | html input[disabled] { 302 | cursor: default; 303 | } 304 | 305 | /** 306 | * Remove inner padding and border in Firefox 4+. 307 | */ 308 | 309 | button::-moz-focus-inner, 310 | input::-moz-focus-inner { 311 | border: 0; 312 | padding: 0; 313 | } 314 | 315 | /** 316 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 317 | * the UA stylesheet. 318 | */ 319 | 320 | input { 321 | line-height: normal; 322 | } 323 | 324 | /** 325 | * It's recommended that you don't attempt to style these elements. 326 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 327 | * 328 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 329 | * 2. Remove excess padding in IE 8/9/10. 330 | */ 331 | 332 | input[type="checkbox"], 333 | input[type="radio"] { 334 | box-sizing: border-box; /* 1 */ 335 | padding: 0; /* 2 */ 336 | } 337 | 338 | /** 339 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 340 | * `font-size` values of the `input`, it causes the cursor style of the 341 | * decrement button to change from `default` to `text`. 342 | */ 343 | 344 | input[type="number"]::-webkit-inner-spin-button, 345 | input[type="number"]::-webkit-outer-spin-button { 346 | height: auto; 347 | } 348 | 349 | /** 350 | * 1. Address `appearance` set to `searchfield` in Safari and Chrome. 351 | * 2. Address `box-sizing` set to `border-box` in Safari and Chrome 352 | * (include `-moz` to future-proof). 353 | */ 354 | 355 | input[type="search"] { 356 | -webkit-appearance: textfield; /* 1 */ 357 | -moz-box-sizing: content-box; 358 | -webkit-box-sizing: content-box; /* 2 */ 359 | box-sizing: content-box; 360 | } 361 | 362 | /** 363 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 364 | * Safari (but not Chrome) clips the cancel button when the search input has 365 | * padding (and `textfield` appearance). 366 | */ 367 | 368 | input[type="search"]::-webkit-search-cancel-button, 369 | input[type="search"]::-webkit-search-decoration { 370 | -webkit-appearance: none; 371 | } 372 | 373 | /** 374 | * Define consistent border, margin, and padding. 375 | */ 376 | 377 | fieldset { 378 | border: 1px solid #c0c0c0; 379 | margin: 0 2px; 380 | padding: 0.35em 0.625em 0.75em; 381 | } 382 | 383 | /** 384 | * 1. Correct `color` not being inherited in IE 8/9/10/11. 385 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 386 | */ 387 | 388 | legend { 389 | border: 0; /* 1 */ 390 | padding: 0; /* 2 */ 391 | } 392 | 393 | /** 394 | * Remove default vertical scrollbar in IE 8/9/10/11. 395 | */ 396 | 397 | textarea { 398 | overflow: auto; 399 | } 400 | 401 | /** 402 | * Don't inherit the `font-weight` (applied by a rule above). 403 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 404 | */ 405 | 406 | optgroup { 407 | font-weight: bold; 408 | } 409 | 410 | /* Tables 411 | ========================================================================== */ 412 | 413 | /** 414 | * Remove most spacing between table cells. 415 | */ 416 | 417 | table { 418 | border-collapse: collapse; 419 | border-spacing: 0; 420 | } 421 | 422 | td, 423 | th { 424 | padding: 0; 425 | } 426 | -------------------------------------------------------------------------------- /css/app.css: -------------------------------------------------------------------------------- 1 | /* General Setting */ 2 | 3 | /* Small screens (default) */ 4 | html { font-size: 100%; } 5 | 6 | /* Medium screens (640px) */ 7 | @media (min-width: 40rem) { 8 | html { font-size: 112%; } 9 | } 10 | 11 | /* Large screens (1024px) */ 12 | @media (min-width: 64rem) { 13 | html { font-size: 120%; } 14 | } 15 | 16 | /* Grid */ 17 | 18 | /* Ditto */ 19 | 20 | body { 21 | color: #333; 22 | margin: 0; 23 | padding: 0; 24 | 25 | font-family: Verdana, Arial; 26 | font-size: 0.8rem; 27 | } 28 | 29 | #sidebar { 30 | margin-top: 0; 31 | padding-left: 25px; 32 | padding-bottom:25px; 33 | padding-top: 25px; 34 | 35 | box-shadow: 0 0 40px #CCC; 36 | -webkit-box-shadow: 0 0 40px #CCC; 37 | -moz-box-shadow: 0 0 40px #CCC; 38 | border-right: 1px solid #BBB; 39 | } 40 | 41 | @media (min-width: 40rem) { 42 | #sidebar { 43 | width: 280px; 44 | position: fixed; 45 | height: 100%; 46 | margin-right: 20px; 47 | padding-bottom:0px; 48 | padding-top: 0px; 49 | overflow-y: scroll; 50 | overflow: -moz-scrollbars-vertical; 51 | } 52 | } 53 | 54 | #sidebar h1 { 55 | font-size: 25px; 56 | margin-bottom: 0px; 57 | padding-bottom: 0px; 58 | } 59 | 60 | #sidebar h1 a:link, #sidebar h1 a:visited { 61 | color: #333; 62 | } 63 | 64 | #sidebar h2 { 65 | font-size: 0.7rem; 66 | } 67 | 68 | #sidebar h5 { 69 | margin-top: 20px; 70 | margin-bottom: 0; 71 | } 72 | 73 | #sidebar a:visited, #sidebar a:link { 74 | color: #4682BE; 75 | text-decoration: none; 76 | } 77 | 78 | #sidebar ul { 79 | list-style-type: none; 80 | margin: 0; 81 | padding-left: 10px; 82 | padding-top: 0; 83 | } 84 | 85 | #sidebar ol { 86 | margin: 0; 87 | padding-left: 30px; 88 | padding-top: 0; 89 | } 90 | 91 | #sidebar ul li:before { /* a hack to have dashes as a list style */ 92 | content: "-"; 93 | position: relative; 94 | left: -5px; 95 | } 96 | 97 | #sidebar ul li, 98 | #sidebar ol li { 99 | margin-top: 0; 100 | margin-bottom: 0.2rem; 101 | margin-left: 10px; 102 | padding: 0; 103 | 104 | text-indent: -5px; /* to compensate for the padding for the dash */ 105 | font-size: 0.7rem; 106 | } 107 | 108 | #content { 109 | padding-top: 10px; 110 | padding-bottom: 150px; 111 | margin-left: 20px; 112 | margin-right: 20px; 113 | font-size: 0.8rem; 114 | line-height:1.3rem; 115 | 116 | /* border: 1px solid black; */ 117 | 118 | counter-reset: section; 119 | } 120 | 121 | @media (min-width: 40rem) { 122 | #content { 123 | width: 580px; 124 | padding-left:330px; 125 | margin-left: 0px; 126 | margin-right: 0px; 127 | } 128 | } 129 | 130 | #content pre{ 131 | margin-left: auto; 132 | margin-right: auto; 133 | padding-top: 10px; 134 | padding-bottom: 10px; 135 | padding-left: 0.7rem; 136 | line-height: 1.2; 137 | 138 | color: #FFF; 139 | 140 | background: #111; 141 | border-radius: 5px; 142 | } 143 | 144 | #content code { 145 | padding-right: 5px; 146 | 147 | color: #a6e22e; 148 | font-size: 0.7rem; 149 | font-weight: normal; 150 | font-family: Consolas,"Courier New",Courier,FreeMono,monospace; 151 | 152 | background: #111; 153 | border-radius: 2px; 154 | } 155 | 156 | #content p>code, 157 | #content li>code, 158 | #content h2>code, 159 | #content h3>code{ 160 | color: #c7254e; 161 | background: #f9f2f4; 162 | } 163 | 164 | #content h2 { 165 | margin-top: 50px; 166 | margin-bottom: 0px; 167 | 168 | padding-top: 20px; 169 | padding-bottom: 0px; 170 | 171 | font-size: 18px; 172 | text-align: left; 173 | 174 | border-top: 2px solid #666; 175 | 176 | counter-increment: section; 177 | } 178 | 179 | #content h2:before { 180 | content: counter(section) ". "; 181 | } 182 | 183 | #content h3 { 184 | margin-top: 50px; 185 | margin-bottom: 0px; 186 | 187 | padding-top: 20px; 188 | padding-bottom: 0px; 189 | 190 | text-align: left; 191 | border-top: 1px dotted #777; 192 | } 193 | 194 | #content img { 195 | max-width: 90%; 196 | display: block; 197 | 198 | margin-left: auto; 199 | margin-right: auto; 200 | margin-top: 40px; 201 | margin-bottom: 40px; 202 | 203 | border-radius: 5px; 204 | } 205 | 206 | #content ul { 207 | display: block; 208 | list-style-type: none; 209 | padding-top: 0.5rem; 210 | padding-bottom:0.5rem; 211 | } 212 | 213 | #content ol { 214 | display: block; 215 | padding-top: 0.5rem; 216 | padding-bottom:0.5rem; 217 | } 218 | 219 | 220 | #content ul li:before { /* a hack to have dashes as a list style */ 221 | content: "-"; 222 | position: relative; 223 | left: -5px; 224 | } 225 | 226 | #content ul li, 227 | #content ol li{ 228 | text-indent: -5px; /* to compensate for the padding for the dash */ 229 | font-size: 0.8rem; 230 | } 231 | 232 | #content ul li.link, 233 | #content ol li.link { 234 | color: #2980b9; 235 | text-decoration: none; 236 | font-size: 0.7rem; 237 | font-weight: bold; 238 | cursor: pointer; 239 | } 240 | 241 | #content a:link, #content a:visited { 242 | color: #4682BE; 243 | text-decoration: none; 244 | } 245 | 246 | #content .content-toc{ 247 | background: #bdc3c7; 248 | border-radius: 5px; 249 | } 250 | 251 | #content table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all} 252 | 253 | #content table th{font-weight:bold} 254 | 255 | #content table th, 256 | #content table td{padding:6px 13px;border:1px solid #ddd} 257 | 258 | #content table tr{background-color:#fff;border-top:1px solid #ccc} 259 | #content table tr:nth-child(2n){background-color:#f8f8f8} 260 | 261 | #back_to_top { 262 | display: none; 263 | position: fixed; 264 | 265 | height: 20px; 266 | width: 70px; 267 | top: 20px; 268 | 269 | margin-left: 930px; 270 | margin-top: 0px; 271 | 272 | color: #FFF; 273 | line-height: 20px; 274 | text-align: center; 275 | font-size: 10px; 276 | 277 | 278 | border-radius: 5px; 279 | background-color: #AAA; 280 | } 281 | 282 | #back_to_top:hover { 283 | background-color: #444; 284 | cursor: pointer; 285 | } 286 | 287 | #edit { 288 | display: none; 289 | position: fixed; 290 | 291 | height: 17px; 292 | width: 70px; 293 | top: 45px; 294 | 295 | margin-left: 930px; 296 | margin-top: 0px; 297 | 298 | color: #FFF; 299 | line-height: 17px; 300 | text-align: center; 301 | font-size: 10px; 302 | 303 | 304 | border-radius: 5px; 305 | background-color: #AAA; 306 | } 307 | 308 | #edit:hover { 309 | background-color: #444; 310 | cursor: pointer; 311 | } 312 | 313 | #loading, #error { 314 | display: none; 315 | position: fixed; 316 | 317 | top: 0; 318 | height: 17px; 319 | 320 | font-size: 14px; 321 | } 322 | 323 | @media (min-width: 40rem) { 324 | #loading, #error { 325 | display: none; 326 | position: fixed; 327 | 328 | height: 17px; 329 | top: 45%; 330 | 331 | margin-left: 560px; 332 | 333 | font-size: 14px; 334 | } 335 | } 336 | 337 | #flip{ 338 | position:fixed; 339 | height:20px; 340 | width:100%; 341 | bottom:10px; 342 | font-size:10px; 343 | text-align:center; 344 | } 345 | 346 | #pageup,#pagedown{ 347 | height:20px; 348 | width:70px; 349 | display:inline-block; 350 | border-radius: 5px; 351 | background-color: #AAA; 352 | text-align: center; 353 | line-height:20px; 354 | color: #FFF; 355 | } 356 | 357 | #pageup{ 358 | margin-right:5px; 359 | } 360 | 361 | #pageup:hover, 362 | #pagedown:hover{ 363 | background-color: #444; 364 | cursor: pointer; 365 | } 366 | 367 | #pagedown{ 368 | margin-left:5px; 369 | } 370 | 371 | @media (min-width: 40rem) { 372 | #flip{ 373 | margin-left:545px; 374 | width:150px; 375 | } 376 | } 377 | 378 | .progress-indicator-2 { 379 | position: fixed; 380 | top: 0; 381 | left: 0; 382 | height: 3px; 383 | background-color: #0A74DA; 384 | } 385 | 386 | /** 387 | * okaidia theme for JavaScript, CSS and HTML 388 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 389 | * @author ocodia 390 | */ 391 | 392 | code[class*="language-"], 393 | pre[class*="language-"] { 394 | color: #a6e22e; 395 | text-shadow: 0 1px rgba(0,0,0,0.3); 396 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 397 | direction: ltr; 398 | text-align: left; 399 | white-space: pre; 400 | word-spacing: normal; 401 | word-break: normal; 402 | 403 | -moz-tab-size: 4; 404 | -o-tab-size: 4; 405 | tab-size: 4; 406 | 407 | -webkit-hyphens: none; 408 | -moz-hyphens: none; 409 | -ms-hyphens: none; 410 | hyphens: none; 411 | } 412 | 413 | /* Code blocks */ 414 | pre[class*="language-"] { 415 | padding: 1em; 416 | margin: .5em 0; 417 | overflow: auto; 418 | border-radius: 0.3em; 419 | } 420 | 421 | :not(pre) > code[class*="language-"], 422 | pre[class*="language-"] { 423 | background: #272822; 424 | } 425 | 426 | /* Inline code */ 427 | :not(pre) > code[class*="language-"] { 428 | padding: .1em; 429 | border-radius: .3em; 430 | } 431 | 432 | .token.comment, 433 | .token.prolog, 434 | .token.doctype, 435 | .token.cdata { 436 | color: #75715e; 437 | } 438 | 439 | .token.punctuation { 440 | color: #f8f8f2; 441 | } 442 | 443 | .namespace { 444 | opacity: .7; 445 | } 446 | 447 | .token.property, 448 | .token.tag, 449 | .token.constant, 450 | .token.symbol { 451 | color: #f92672; 452 | } 453 | 454 | .token.boolean, 455 | .token.number{ 456 | color: #ae81ff; 457 | } 458 | 459 | .token.selector, 460 | .token.attr-name, 461 | .token.string, 462 | .token.builtin { 463 | color: #a6e22e; 464 | } 465 | 466 | 467 | .token.operator, 468 | .token.entity, 469 | .token.url, 470 | .language-css .token.string, 471 | .style .token.string, 472 | .token.variable { 473 | color: #f92672; 474 | } 475 | 476 | .token.atrule, 477 | .token.attr-value 478 | { 479 | color: #e6db74; 480 | } 481 | 482 | 483 | .token.keyword{ 484 | color: #66d9ef; 485 | } 486 | 487 | .token.regex, 488 | .token.important { 489 | color: #fd971f; 490 | } 491 | 492 | .token.important { 493 | font-weight: bold; 494 | } 495 | 496 | .token.entity { 497 | cursor: help; 498 | } 499 | -------------------------------------------------------------------------------- /css/normalize.css: -------------------------------------------------------------------------------- 1 | ../app/bower_components/normalize-css/normalize.css -------------------------------------------------------------------------------- /docs/let.md: -------------------------------------------------------------------------------- 1 | # let和const命令 2 | 3 | ## let命令 4 | 5 | ### 基本用法 6 | 7 | ES6新增了`let`命令,用来声明变量。它的用法类似于`var`,但是所声明的变量,只在`let`命令所在的代码块内有效。 8 | 9 | ```javascript 10 | { 11 | let a = 10; 12 | var b = 1; 13 | } 14 | 15 | a // ReferenceError: a is not defined. 16 | b // 1 17 | ``` 18 | 19 | 上面代码在代码块之中,分别用`let`和`var`声明了两个变量。然后在代码块之外调用这两个变量,结果`let`声明的变量报错,`var`声明的变量返回了正确的值。这表明,`let`声明的变量只在它所在的代码块有效。 20 | 21 | `for`循环的计数器,就很合适使用let命令。 22 | 23 | ```javascript 24 | for(let i = 0; i < arr.length; i++){} 25 | 26 | console.log(i) 27 | //ReferenceError: i is not defined 28 | ``` 29 | 30 | 上面代码的计数器`i`,只在`for`循环体内有效。 31 | 32 | 下面的代码如果使用`var`,最后输出的是10。 33 | 34 | ```javascript 35 | var a = []; 36 | for (var i = 0; i < 10; i++) { 37 | a[i] = function () { 38 | console.log(i); 39 | }; 40 | } 41 | a[6](); // 10 42 | ``` 43 | 44 | 如果使用`let`,声明的变量仅在块级作用域内有效,最后输出的是6。 45 | 46 | ```javascript 47 | var a = []; 48 | for (let i = 0; i < 10; i++) { 49 | a[i] = function () { 50 | console.log(i); 51 | }; 52 | } 53 | a[6](); // 6 54 | ``` 55 | 56 | ### 不存在变量提升 57 | 58 | `let`不像`var`那样,会发生“变量提升”现象。 59 | 60 | ```javascript 61 | console.log(foo); // ReferenceError 62 | let foo = 2; 63 | ``` 64 | 65 | 上面代码在声明`foo`之前,就使用这个变量,结果会抛出一个错误。 66 | 67 | 这也意味着`typeof`不再是一个百分之百安全的操作。 68 | 69 | ```javascript 70 | typeof x; // ReferenceError 71 | let x; 72 | ``` 73 | 74 | 上面代码中,由于块级作用域内`typeof`运行时,`x`还没有值,所以会抛出一个`ReferenceError`。 75 | 76 | ### 暂时性死区 77 | 78 | 只要块级作用域内存在`let`命令,它所声明的变量就“绑定”(binding)这个区域,不再受外部的影响。 79 | 80 | ```javascript 81 | var tmp = 123; 82 | 83 | if (true) { 84 | tmp = 'abc'; // ReferenceError 85 | let tmp; 86 | } 87 | ``` 88 | 89 | 上面代码中,存在全局变量`tmp`,但是块级作用域内`let`又声明了一个局部变量`tmp`,导致后者绑定这个块级作用域,所以在`let`声明变量前,对`tmp`赋值会报错。 90 | 91 | ES6明确规定,如果区块中存在`let`和`const`命令,这个区块对这些命令声明的变量,从一开始就形成了封闭作用域。凡是在声明之前就使用这些命令,就会报错。 92 | 93 | 总之,在代码块内,使用let命令声明变量之前,该变量都是不可用的。这在语法上,称为“暂时性死区”(temporal dead zone,简称TDZ)。 94 | 95 | ```javascript 96 | if (true) { 97 | // TDZ开始 98 | tmp = 'abc'; // ReferenceError 99 | console.log(tmp); // ReferenceError 100 | 101 | let tmp; // TDZ结束 102 | console.log(tmp); // undefined 103 | 104 | tmp = 123; 105 | console.log(tmp); // 123 106 | } 107 | ``` 108 | 109 | 上面代码中,在`let`命令声明变量`tmp`之前,都属于变量`tmp`的“死区”。 110 | 111 | 有些“死区”比较隐蔽,不太容易发现。 112 | 113 | ```javascript 114 | function bar(x = y, y = 2) { 115 | return [x, y]; 116 | } 117 | 118 | bar(); // 报错 119 | ``` 120 | 121 | 上面代码中,调用`bar`函数之所以报错,是因为参数`x`默认值等于另一个参数`y`,而此时`y`还没有声明,属于”死区“。如果`y`的默认值是`x`,就不会报错,因为此时`x`已经声明了。 122 | 123 | ```javascript 124 | function bar(x = 2, y = x) { 125 | return [x, y]; 126 | } 127 | bar(); // [2, 2] 128 | ``` 129 | 130 | ES6规定暂时性死区和不存在变量提升,主要是为了减少运行时错误,防止在变量声明前就使用这个变量,从而导致意料之外的行为。这样的错误在ES5是很常见的,现在有了这种规定,避免此类错误就很容易了。 131 | 132 | 总之,暂时性死区的本质就是,只要一进入当前作用域,所要使用的变量就已经存在了,但是不可获取,只有等到声明变量的那一行代码出现,才可以获取和使用该变量。 133 | 134 | ### 不允许重复声明 135 | 136 | let不允许在相同作用域内,重复声明同一个变量。 137 | 138 | ```javascript 139 | // 报错 140 | function () { 141 | let a = 10; 142 | var a = 1; 143 | } 144 | 145 | // 报错 146 | function () { 147 | let a = 10; 148 | let a = 1; 149 | } 150 | ``` 151 | 152 | 因此,不能在函数内部重新声明参数。 153 | 154 | ```javascript 155 | function func(arg) { 156 | let arg; // 报错 157 | } 158 | 159 | function func(arg) { 160 | { 161 | let arg; // 不报错 162 | } 163 | } 164 | ``` 165 | 166 | ## 块级作用域 167 | 168 | ### 为什么需要块级作用域? 169 | 170 | ES5只有全局作用域和函数作用域,没有块级作用域,这带来很多不合理的场景。 171 | 172 | 第一种场景,内层变量可能会覆盖外层变量。 173 | 174 | ```javascript 175 | var tmp = new Date(); 176 | 177 | function f(){ 178 | console.log(tmp); 179 | if (false){ 180 | var tmp = "hello world"; 181 | } 182 | } 183 | 184 | f() // undefined 185 | ``` 186 | 187 | 上面代码中,函数f执行后,输出结果为`undefined`,原因在于变量提升,导致内层的tmp变量覆盖了外层的tmp变量。 188 | 189 | 第二种场景,用来计数的循环变量泄露为全局变量。 190 | 191 | ```javascript 192 | var s = 'hello'; 193 | 194 | for (var i = 0; i < s.length; i++){ 195 | console.log(s[i]); 196 | } 197 | 198 | console.log(i); // 5 199 | ``` 200 | 201 | 上面代码中,变量i只用来控制循环,但是循环结束后,它并没有消失,泄露成了全局变量。 202 | 203 | ### ES6的块级作用域 204 | 205 | `let`实际上为JavaScript新增了块级作用域。 206 | 207 | ```javascript 208 | function f1() { 209 | let n = 5; 210 | if (true) { 211 | let n = 10; 212 | } 213 | console.log(n); // 5 214 | } 215 | ``` 216 | 217 | 上面的函数有两个代码块,都声明了变量`n`,运行后输出5。这表示外层代码块不受内层代码块的影响。如果使用`var`定义变量`n`,最后输出的值就是10。 218 | 219 | ES6允许块级作用域的任意嵌套。 220 | 221 | ```javascript 222 | {{{{{let insane = 'Hello World'}}}}}; 223 | ``` 224 | 225 | 上面代码使用了一个五层的块级作用域。外层作用域无法读取内层作用域的变量。 226 | 227 | ```javascript 228 | {{{{ 229 | {let insane = 'Hello World'} 230 | console.log(insane); // 报错 231 | }}}}; 232 | ``` 233 | 234 | 内层作用域可以定义外层作用域的同名变量。 235 | 236 | ```javascript 237 | {{{{ 238 | let insane = 'Hello World'; 239 | {let insane = 'Hello World';} 240 | }}}}; 241 | ``` 242 | 243 | 块级作用域的出现,实际上使得获得广泛应用的立即执行匿名函数(IIFE)不再必要了。 244 | 245 | ```javascript 246 | // IIFE写法 247 | (function () { 248 | var tmp = ...; 249 | ... 250 | }()); 251 | 252 | // 块级作用域写法 253 | { 254 | let tmp = ...; 255 | ... 256 | } 257 | ``` 258 | 259 | 另外,ES6也规定,函数本身的作用域,在其所在的块级作用域之内。 260 | 261 | ```javascript 262 | function f() { console.log('I am outside!'); } 263 | (function () { 264 | if(false) { 265 | // 重复声明一次函数f 266 | function f() { console.log('I am inside!'); } 267 | } 268 | 269 | f(); 270 | }()); 271 | ``` 272 | 273 | 上面代码在ES5中运行,会得到“I am inside!”,但是在ES6中运行,会得到“I am outside!”。这是因为ES5存在函数提升,不管会不会进入 `if`代码块,函数声明都会提升到当前作用域的顶部,得到执行;而ES6支持块级作用域,不管会不会进入if代码块,其内部声明的函数皆不会影响到作用域的外部。 274 | 275 | ```javascript 276 | { 277 | let a = 'secret'; 278 | function f() { 279 | return a; 280 | } 281 | } 282 | f() // 报错 283 | ``` 284 | 285 | 上面代码中,块级作用域外部,无法调用块级作用域内部定义的函数。如果确实需要调用,就要像下面这样处理。 286 | 287 | ```javascript 288 | let f; 289 | { 290 | let a = 'secret'; 291 | f = function () { 292 | return a; 293 | } 294 | } 295 | f() // "secret" 296 | ``` 297 | 298 | 需要注意的是,如果在严格模式下,函数只能在顶层作用域和函数内声明,其他情况(比如if代码块、循环代码块)的声明都会报错。 299 | 300 | ## const命令 301 | 302 | const也用来声明变量,但是声明的是常量。一旦声明,常量的值就不能改变。 303 | 304 | ```javascript 305 | const PI = 3.1415; 306 | PI // 3.1415 307 | 308 | PI = 3; 309 | // TypeError: "PI" is read-only 310 | ``` 311 | 312 | 上面代码表明改变常量的值会报错。 313 | 314 | const声明的变量不得改变值,这意味着,const一旦声明变量,就必须立即初始化,不能留到以后赋值。 315 | 316 | ```javascript 317 | const foo; 318 | // SyntaxError: missing = in const declaration 319 | ``` 320 | 321 | 上面代码表示,对于const来说,只声明不赋值,就会报错。 322 | 323 | const的作用域与let命令相同:只在声明所在的块级作用域内有效。 324 | 325 | ```javascript 326 | if (true) { 327 | const MAX = 5; 328 | } 329 | 330 | MAX // Uncaught ReferenceError: MAX is not defined 331 | ``` 332 | 333 | const命令声明的常量也是不提升,同样存在暂时性死区,只能在声明的位置后面使用。 334 | 335 | ```javascript 336 | if (true) { 337 | console.log(MAX); // ReferenceError 338 | const MAX = 5; 339 | } 340 | ``` 341 | 342 | 上面代码在常量`MAX`声明之前就调用,结果报错。 343 | 344 | const声明的常量,也与`let`一样不可重复声明。 345 | 346 | ```javascript 347 | var message = "Hello!"; 348 | let age = 25; 349 | 350 | // 以下两行都会报错 351 | const message = "Goodbye!"; 352 | const age = 30; 353 | ``` 354 | 355 | 对于复合类型的变量,变量名不指向数据,而是指向数据所在的地址。const命令只是保证变量名指向的地址不变,并不保证该地址的数据不变,所以将一个对象声明为常量必须非常小心。 356 | 357 | ```javascript 358 | const foo = {}; 359 | foo.prop = 123; 360 | 361 | foo.prop 362 | // 123 363 | 364 | foo = {} // TypeError: "foo" is read-only不起作用 365 | ``` 366 | 367 | 上面代码中,常量`foo`储存的是一个地址,这个地址指向一个对象。不可变的只是这个地址,即不能把`foo`指向另一个地址,但对象本身是可变的,所以依然可以为其添加新属性。 368 | 369 | 下面是另一个例子。 370 | 371 | ```js 372 | const a = []; 373 | a.push("Hello"); // 可执行 374 | a.length = 0; // 可执行 375 | a = ["Dave"]; // 报错 376 | ``` 377 | 378 | 上面代码中,常量`a`是一个数组,这个数组本身是可写的,但是如果将另一个数组赋值给`a`,就会报错。 379 | 380 | 如果真的想将对象冻结,应该使用`Object.freeze`方法。 381 | 382 | ```javascript 383 | const foo = Object.freeze({}); 384 | foo.prop = 123; // 不起作用 385 | ``` 386 | 387 | 上面代码中,常量`foo`指向一个冻结的对象,所以添加新属性不起作用。 388 | 389 | 除了将对象本身冻结,对象的属性也应该冻结。下面是一个将对象彻底冻结的函数。 390 | 391 | ```javascript 392 | var constantize = (obj) => { 393 | Object.freeze(obj); 394 | Object.keys(obj).forEach( (key, value) => { 395 | if ( typeof obj[key] === 'object' ) { 396 | constantize( obj[key] ); 397 | } 398 | }); 399 | }; 400 | ``` 401 | 402 | ES5只有两种声明变量的方法:var命令和function命令。ES6除了添加let和const命令,后面章节还会提到,另外两种声明变量的方法:import命令和class命令。所以,ES6一共有6种声明变量的方法。 403 | 404 | ## 跨模块常量 405 | 406 | 上面说过,const声明的常量只在当前代码块有效。如果想设置跨模块的常量,可以采用下面的写法。 407 | 408 | ```javascript 409 | // constants.js 模块 410 | export const A = 1; 411 | export const B = 3; 412 | export const C = 4; 413 | 414 | // test1.js 模块 415 | import * as constants from './constants'; 416 | console.log(constants.A); // 1 417 | console.log(constants.B); // 3 418 | 419 | // test2.js 模块 420 | import {A, B} from './constants'; 421 | console.log(A); // 1 422 | console.log(B); // 3 423 | ``` 424 | 425 | ## 全局对象的属性 426 | 427 | 全局对象是最顶层的对象,在浏览器环境指的是`window`象,在Node.js指的是`global`对象。ES5之中,全局对象的属性与全局变量是等价的。 428 | 429 | ```javascript 430 | window.a = 1; 431 | a // 1 432 | 433 | a = 2; 434 | window.a // 2 435 | ``` 436 | 437 | 上面代码中,全局对象的属性赋值与全局变量的赋值,是同一件事。(对于Node来说,这一条只对REPL环境适用,模块环境之中,全局变量必须显式声明成`global`对象的属性。) 438 | 439 | 这种规定被视为JavaScript语言的一大问题,因为很容易不知不觉就创建了全局变量。ES6为了改变这一点,一方面规定,var命令和function命令声明的全局变量,依旧是全局对象的属性;另一方面规定,let命令、const命令、class命令声明的全局变量,不属于全局对象的属性。 440 | 441 | ```javascript 442 | var a = 1; 443 | // 如果在Node的REPL环境,可以写成global.a 444 | // 或者采用通用方法,写成this.a 445 | window.a // 1 446 | 447 | let b = 1; 448 | window.b // undefined 449 | ``` 450 | 451 | 上面代码中,全局变量`a`由`var`命令声明,所以它是全局对象的属性;全局变量`b`由`let`命令声明,所以它不是全局对象的属性,返回`undefined`。 452 | -------------------------------------------------------------------------------- /docs/regex.md: -------------------------------------------------------------------------------- 1 | # 正则的扩展 2 | 3 | ## RegExp构造函数 4 | 5 | 在ES5中,RegExp构造函数只能接受字符串作为参数。 6 | 7 | ```javascript 8 | var regex = new RegExp("xyz", "i"); 9 | // 等价于 10 | var regex = /xyz/i; 11 | ``` 12 | 13 | ES6允许RegExp构造函数接受正则表达式作为参数,这时会返回一个原有正则表达式的拷贝。 14 | 15 | ```javascript 16 | var regex = new RegExp(/xyz/i); 17 | ``` 18 | 19 | 如果使用RegExp构造函数的第二个参数指定修饰符,则返回的正则表达式会忽略原有的正则表达式的修饰符,只使用新指定的修饰符。 20 | 21 | ```javascript 22 | new RegExp(/abc/ig, 'i').flags 23 | // "i" 24 | ``` 25 | 26 | ## 字符串的正则方法 27 | 28 | 字符串对象共有4个方法,可以使用正则表达式:match()、replace()、search()和split()。 29 | 30 | ES6将这4个方法,在语言内部全部调用RegExp的实例方法,从而做到所有与正则相关的方法,全都定义在RegExp对象上。 31 | 32 | - String.prototype.match 调用 RegExp.prototype[Symbol.match] 33 | - String.prototype.replace 调用 RegExp.prototype[Symbol.replace] 34 | - String.prototype.search 调用 RegExp.prototype[Symbol.search] 35 | - String.prototype.split 调用 RegExp.prototype[Symbol.split] 36 | 37 | ## u修饰符 38 | 39 | ES6对正则表达式添加了u修饰符,含义为“Unicode模式”,用来正确处理大于`\uFFFF`的Unicode字符。也就是说,会正确处理四个字节的UTF-16编码。 40 | 41 | ```javascript 42 | /^\uD83D/u.test('\uD83D\uDC2A') 43 | // false 44 | /^\uD83D/.test('\uD83D\uDC2A') 45 | // true 46 | ``` 47 | 48 | 上面代码中,“\uD83D\uDC2A”是一个四个字节的UTF-16编码,代表一个字符。但是,ES5不支持四个字节的UTF-16编码,会将其识别为两个字符,导致第二行代码结果为true。加了u修饰符以后,ES6就会识别其为一个字符,所以第一行代码结果为false。 49 | 50 | 一旦加上u修饰符号,就会修改下面这些正则表达式的行为。 51 | 52 | **(1)点字符** 53 | 54 | 点(.)字符在正则表达式中,含义是除了换行符以外的任意单个字符。对于码点大于`0xFFFF`的Unicode字符,点字符不能识别,必须加上u修饰符。 55 | 56 | ```javascript 57 | var s = "𠮷"; 58 | 59 | /^.$/.test(s) // false 60 | /^.$/u.test(s) // true 61 | ``` 62 | 63 | 上面代码表示,如果不添加u修饰符,正则表达式就会认为字符串为两个字符,从而匹配失败。 64 | 65 | **(2)Unicode字符表示法** 66 | 67 | ES6新增了使用大括号表示Unicode字符,这种表示法在正则表达式中必须加上u修饰符,才能识别。 68 | 69 | ```javascript 70 | /\u{61}/.test('a') // false 71 | /\u{61}/u.test('a') // true 72 | /\u{20BB7}/u.test('𠮷') // true 73 | ``` 74 | 75 | 上面代码表示,如果不加u修饰符,正则表达式无法识别`\u{61}`这种表示法,只会认为这匹配61个连续的u。 76 | 77 | **(3)量词** 78 | 79 | 使用u修饰符后,所有量词都会正确识别大于码点大于`0xFFFF`的Unicode字符。 80 | 81 | ```javascript 82 | /a{2}/.test('aa') // true 83 | /a{2}/u.test('aa') // true 84 | /𠮷{2}/.test('𠮷𠮷') // false 85 | /𠮷{2}/u.test('𠮷𠮷') // true 86 | ``` 87 | 88 | 另外,只有在使用u修饰符的情况下,Unicode表达式当中的大括号才会被正确解读,否则会被解读为量词。 89 | 90 | ```javascript 91 | /^\u{3}$/.test('uuu') // true 92 | ``` 93 | 94 | 上面代码中,由于正则表达式没有u修饰符,所以大括号被解读为量词。加上u修饰符,就会被解读为Unicode表达式。 95 | 96 | **(4)预定义模式** 97 | 98 | u修饰符也影响到预定义模式,能否正确识别码点大于`0xFFFF`的Unicode字符。 99 | 100 | ```javascript 101 | /^\S$/.test('𠮷') // false 102 | /^\S$/u.test('𠮷') // true 103 | ``` 104 | 105 | 上面代码的`\S`是预定义模式,匹配所有不是空格的字符。只有加了u修饰符,它才能正确匹配码点大于0xFFFF的Unicode字符。 106 | 107 | 利用这一点,可以写出一个正确返回字符串长度的函数。 108 | 109 | ```javascript 110 | function codePointLength(text) { 111 | var result = text.match(/[\s\S]/gu); 112 | return result ? result.length : 0; 113 | } 114 | 115 | var s = "𠮷𠮷"; 116 | 117 | s.length // 4 118 | codePointLength(s) // 2 119 | ``` 120 | 121 | **(5)i修饰符** 122 | 123 | 有些Unicode字符的编码不同,但是字型很相近,比如,\u004B与\u212A都是大写的K。 124 | 125 | ```javascript 126 | /[a-z]/i.test('\u212A') // false 127 | /[a-z]/iu.test('\u212A') // true 128 | ``` 129 | 130 | 上面代码中,不加u修饰符,就无法识别非规范的K字符。 131 | 132 | ## y修饰符 133 | 134 | 除了u修饰符,ES6还为正则表达式添加了y修饰符,叫做“粘连”(sticky)修饰符。 135 | 136 | y修饰符的作用与g修饰符类似,也是全局匹配,后一次匹配都从上一次匹配成功的下一个位置开始。不同之处在于,g修饰符只要剩余位置中存在匹配就可,而y修饰符确保匹配必须从剩余的第一个位置开始,这也就是“粘连”的涵义。 137 | 138 | ```javascript 139 | var s = "aaa_aa_a"; 140 | var r1 = /a+/g; 141 | var r2 = /a+/y; 142 | 143 | r1.exec(s) // ["aaa"] 144 | r2.exec(s) // ["aaa"] 145 | 146 | r1.exec(s) // ["aa"] 147 | r2.exec(s) // null 148 | ``` 149 | 150 | 上面代码有两个正则表达式,一个使用g修饰符,另一个使用y修饰符。这两个正则表达式各执行了两次,第一次执行的时候,两者行为相同,剩余字符串都是“_aa_a”。由于g修饰没有位置要求,所以第二次执行会返回结果,而y修饰符要求匹配必须从头部开始,所以返回null。 151 | 152 | 如果改一下正则表达式,保证每次都能头部匹配,y修饰符就会返回结果了。 153 | 154 | ```javascript 155 | var s = "aaa_aa_a"; 156 | var r = /a+_/y; 157 | 158 | r.exec(s) // ["aaa_"] 159 | r.exec(s) // ["aa_"] 160 | ``` 161 | 162 | 上面代码每次匹配,都是从剩余字符串的头部开始。 163 | 164 | 使用lastIndex属性,可以更好地说明y修饰符。 165 | 166 | ```javascript 167 | const REGEX = /a/g; 168 | 169 | REGEX.lastIndex = 2; // 指定从第三个位置y开始搜索 170 | const match = REGEX.exec('xaya'); 171 | 172 | match.index 173 | // 3 174 | REGEX.lastIndex 175 | // 4 176 | REGEX.exec('xaxa') 177 | // null 178 | ``` 179 | 180 | 上面代码中,lastIndex属性指定每次搜索的开始位置,g修饰符从这个位置开始向后搜索,直到发现匹配为止。 181 | 182 | y修饰符同样遵守lastIndex属性,但是要求必须在lastIndex指定的位置发现匹配。 183 | 184 | ```javascript 185 | const REGEX = /a/y; 186 | 187 | // 第三个位置y不匹配 188 | REGEX.lastIndex = 2; 189 | console.log(REGEX.exec('xaya')); // null 190 | 191 | // 第四个位置出现匹配 192 | REGEX.lastIndex = 3; 193 | const match = REGEX.exec('xaxa'); 194 | match.index // 3 195 | REGEX.lastIndex // 4 196 | ``` 197 | 198 | 进一步说,y修饰符号隐含了头部匹配的标志ˆ。 199 | 200 | ```javascript 201 | /b/y.exec("aba") 202 | // null 203 | ``` 204 | 205 | 上面代码由于不能保证头部匹配,所以返回null。y修饰符的设计本意,就是让头部匹配的标志ˆ在全局匹配中都有效。 206 | 207 | 在split方法中使用y修饰符,原字符串必须以分隔符开头。这也意味着,只要匹配成功,数组的第一个成员肯定是空字符串。 208 | 209 | ```javascript 210 | // 没有找到匹配 211 | 'x##'.split(/#/y) 212 | // [ 'x##' ] 213 | 214 | // 找到两个匹配 215 | '##x'.split(/#/y) 216 | // [ '', '', 'x' ] 217 | ``` 218 | 219 | 后续的分隔符只有紧跟前面的分隔符,才会被识别。 220 | 221 | ```javascript 222 | '#x#'.split(/#/y) 223 | // [ '', 'x#' ] 224 | 225 | '##'.split(/#/y) 226 | // [ '', '', '' ] 227 | ``` 228 | 229 | 下面是字符串对象的replace方法的例子。 230 | 231 | ```javascript 232 | const REGEX = /a/gy; 233 | 'aaxa'.replace(REGEX, '-') // '--xa' 234 | ``` 235 | 236 | 上面代码中,最后一个a因为不是出现下一次匹配的头部,所以不会被替换。 237 | 238 | 如果同时使用g修饰符和y修饰符,则y修饰符覆盖g修饰符。 239 | 240 | y修饰符的主要作用,是从字符串提取token(词元),y修饰符确保了匹配之间不会有漏掉的字符。 241 | 242 | ```javascript 243 | function tokenize(TOKEN_REGEX, str) { 244 | let result = []; 245 | let match; 246 | while (match = TOKEN_REGEX.exec(str)) { 247 | result.push(match[1]); 248 | } 249 | return result; 250 | } 251 | 252 | const TOKEN_Y = /\s*(\+|[0-9]+)\s*/y; 253 | const TOKEN_G = /\s*(\+|[0-9]+)\s*/g; 254 | 255 | tokenize(TOKEN_Y, '3 + 4') 256 | // [ '3', '+', '4' ] 257 | tokenize(TOKEN_G, '3 + 4') 258 | // [ '3', '+', '4' ] 259 | ``` 260 | 261 | 上面代码中,如果字符串里面没有非法字符,y修饰符与g修饰符的提取结果是一样的。但是,一旦出现非法字符,两者的行为就不一样了。 262 | 263 | ```javascript 264 | tokenize(TOKEN_Y, '3x + 4') 265 | // [ '3' ] 266 | tokenize(TOKEN_G, '3x + 4') 267 | // [ '3', '+', '4' ] 268 | ``` 269 | 270 | 上面代码中,g修饰符会忽略非法字符,而y修饰符不会,这样就很容易发现错误。 271 | 272 | ## sticky属性 273 | 274 | 与y修饰符相匹配,ES6的正则对象多了sticky属性,表示是否设置了y修饰符。 275 | 276 | ```javascript 277 | var r = /hello\d/y; 278 | r.sticky // true 279 | ``` 280 | 281 | ## flags属性 282 | 283 | ES6为正则表达式新增了flags属性,会返回正则表达式的修饰符。 284 | 285 | ```javascript 286 | // ES5的source属性 287 | // 返回正则表达式的正文 288 | /abc/ig.source 289 | // "abc" 290 | 291 | // ES6的flags属性 292 | // 返回正则表达式的修饰符 293 | /abc/ig.flags 294 | // 'gi' 295 | ``` 296 | 297 | ## RegExp.escape() 298 | 299 | 字符串必须转义,才能作为正则模式。 300 | 301 | ```javascript 302 | function escapeRegExp(str) { 303 | return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 304 | } 305 | 306 | let str = '/path/to/resource.html?search=query'; 307 | escapeRegExp(str) 308 | // "\/path\/to\/resource\.html\?search=query" 309 | ``` 310 | 311 | 上面代码中,str是一个正常字符串,必须使用反斜杠对其中的特殊字符转义,才能用来作为一个正则匹配的模式。 312 | 313 | 已经有[提议](https://esdiscuss.org/topic/regexp-escape)将这个需求标准化,作为RegExp对象的静态方法[RegExp.escape()](https://github.com/benjamingr/RexExp.escape),放入ES7。2015年7月31日,TC39认为,这个方法有安全风险,又不愿这个方法变得过于复杂,没有同意将其列入ES7,但这不失为一个真实的需求。 314 | 315 | ```javascript 316 | RegExp.escape("The Quick Brown Fox"); 317 | // "The Quick Brown Fox" 318 | 319 | RegExp.escape("Buy it. use it. break it. fix it.") 320 | // "Buy it\. use it\. break it\. fix it\." 321 | 322 | RegExp.escape("(*.*)"); 323 | // "\(\*\.\*\)" 324 | ``` 325 | 326 | 字符串转义以后,可以使用RegExp构造函数生成正则模式。 327 | 328 | ```javascript 329 | var str = 'hello. how are you?'; 330 | var regex = new RegExp(RegExp.escape(str), 'g'); 331 | assert.equal(String(regex), '/hello\. how are you\?/g'); 332 | ``` 333 | 334 | 目前,该方法可以用上文的escapeRegExp函数或者垫片模块[regexp.escape](https://github.com/ljharb/regexp.escape)实现。 335 | 336 | ```javascript 337 | var escape = require('regexp.escape'); 338 | escape('hi. how are you?') 339 | "hi\\. how are you\\?" 340 | ``` 341 | 342 | -------------------------------------------------------------------------------- /docs/style.md: -------------------------------------------------------------------------------- 1 | # 编程风格 2 | 3 | 本章探讨如何将ES6的新语法,运用到编码实践之中,与传统的JavaScript语法结合在一起,写出合理的、易于阅读和维护的代码。多家公司和组织已经公开了它们的风格规范,具体可参阅[jscs.info](http://jscs.info/),下面的内容主要参考了[Airbnb](https://github.com/airbnb/javascript)的JavaScript风格规范。 4 | 5 | ## 块级作用域 6 | 7 | **(1)let取代var** 8 | 9 | ES6提出了两个新的声明变量的命令:let和const。其中,let完全可以取代var,因为两者语义相同,而且let没有副作用。 10 | 11 | ```javascript 12 | "use strict"; 13 | 14 | if(true) { 15 | let x = 'hello'; 16 | } 17 | 18 | for (let i = 0; i < 10; i++) { 19 | console.log(i); 20 | } 21 | ``` 22 | 23 | 上面代码如果用var替代let,实际上就声明了一个全局变量,这显然不是本意。变量应该只在其声明的代码块内有效,var命令做不到这一点。 24 | 25 | var命令存在变量提升效用,let命令没有这个问题。 26 | 27 | ```javascript 28 | "use strict"; 29 | 30 | if(true) { 31 | console.log(x); // ReferenceError 32 | let x = 'hello'; 33 | } 34 | ``` 35 | 36 | 上面代码如果使用var替代let,console.log那一行就不会报错,而是会输出undefined,因为变量声明提升到代码块的头部。这违反了变量先声明后使用的原则。 37 | 38 | 所以,建议不再使用var命令,而是使用let命令取代。 39 | 40 | **(2)全局常量和线程安全** 41 | 42 | 在let和const之间,建议优先使用const,尤其是在全局环境,不应该设置变量,只应设置常量。这符合函数式编程思想,有利于将来的分布式运算。 43 | 44 | ```javascript 45 | // bad 46 | var a = 1, b = 2, c = 3; 47 | 48 | // good 49 | const a = 1; 50 | const b = 2; 51 | const c = 3; 52 | 53 | // best 54 | const [a, b, c] = [1, 2, 3]; 55 | ``` 56 | 57 | const声明常量还有两个好处,一是阅读代码的人立刻会意识到不应该修改这个值,二是防止了无意间修改变量值所导致的错误。 58 | 59 | 所有的函数都应该设置为常量。 60 | 61 | let表示的变量,只应出现在单线程运行的代码中,不能是多线程共享的,这样有利于保证线程安全。 62 | 63 | **(3)严格模式** 64 | 65 | V8引擎只在严格模式之下,支持let和const。结合前两点,这实际上意味着,将来所有的编程都是针对严格模式的。 66 | 67 | ## 字符串 68 | 69 | 静态字符串一律使用单引号或反引号,不使用双引号。动态字符串使用反引号。 70 | 71 | ```javascript 72 | // bad 73 | const a = "foobar"; 74 | const b = 'foo' + a + 'bar'; 75 | 76 | // acceptable 77 | const c = `foobar`; 78 | 79 | // good 80 | const a = 'foobar'; 81 | const b = `foo${a}bar`; 82 | const c = 'foobar'; 83 | ``` 84 | 85 | ## 解构赋值 86 | 87 | 使用数组成员对变量赋值,优先使用解构赋值。 88 | 89 | ```javascript 90 | const arr = [1, 2, 3, 4]; 91 | 92 | // bad 93 | const first = arr[0]; 94 | const second = arr[1]; 95 | 96 | // good 97 | const [first, second] = arr; 98 | ``` 99 | 100 | 函数的参数如果是对象的成员,优先使用解构赋值。 101 | 102 | ```javascript 103 | // bad 104 | function getFullName(user) { 105 | const firstName = user.firstName; 106 | const lastName = user.lastName; 107 | } 108 | 109 | // good 110 | function getFullName(obj) { 111 | const { firstName, lastName } = obj; 112 | } 113 | 114 | // best 115 | function getFullName({ firstName, lastName }) { 116 | } 117 | ``` 118 | 119 | 如果函数返回多个值,优先使用对象的解构赋值,而不是数组的解构赋值。这样便于以后添加返回值,以及更改返回值的顺序。 120 | 121 | ```javascript 122 | // bad 123 | function processInput(input) { 124 | return [left, right, top, bottom]; 125 | } 126 | 127 | // good 128 | function processInput(input) { 129 | return { left, right, top, bottom }; 130 | } 131 | 132 | const { left, right } = processInput(input); 133 | ``` 134 | 135 | ## 对象 136 | 137 | 单行定义的对象,最后一个成员不以逗号结尾。多行定义的对象,最后一个成员以逗号结尾。 138 | 139 | ```javascript 140 | // bad 141 | const a = { k1: v1, k2: v2, }; 142 | const b = { 143 | k1: v1, 144 | k2: v2 145 | }; 146 | 147 | // good 148 | const a = { k1: v1, k2: v2 }; 149 | const b = { 150 | k1: v1, 151 | k2: v2, 152 | }; 153 | ``` 154 | 155 | 对象尽量静态化,一旦定义,就不得随意添加新的属性。如果添加属性不可避免,要使用Object.assign方法。 156 | 157 | ```javascript 158 | // bad 159 | const a = {}; 160 | a.x = 3; 161 | 162 | // if reshape unavoidable 163 | const a = {}; 164 | Object.assign(a, { x: 3 }); 165 | 166 | // good 167 | const a = { x: null }; 168 | a.x = 3; 169 | ``` 170 | 171 | 如果对象的属性名是动态的,可以在创造对象的时候,使用属性表达式定义。 172 | 173 | ```javascript 174 | // bad 175 | const obj = { 176 | id: 5, 177 | name: 'San Francisco', 178 | }; 179 | obj[getKey('enabled')] = true; 180 | 181 | // good 182 | const obj = { 183 | id: 5, 184 | name: 'San Francisco', 185 | [getKey('enabled')]: true, 186 | }; 187 | ``` 188 | 189 | 上面代码中,对象obj的最后一个属性名,需要计算得到。这时最好采用属性表达式,在新建obj的时候,将该属性与其他属性定义在一起。这样一来,所有属性就在一个地方定义了。 190 | 191 | 另外,对象的属性和方法,尽量采用简洁表达法,这样易于描述和书写。 192 | 193 | ```javascript 194 | var ref = 'some value'; 195 | 196 | // bad 197 | const atom = { 198 | ref: ref, 199 | 200 | value: 1, 201 | 202 | addValue: function (value) { 203 | return atom.value + value; 204 | }, 205 | }; 206 | 207 | // good 208 | const atom = { 209 | ref, 210 | 211 | value: 1, 212 | 213 | addValue(value) { 214 | return atom.value + value; 215 | }, 216 | }; 217 | ``` 218 | 219 | ## 数组 220 | 221 | 使用扩展运算符(...)拷贝数组。 222 | 223 | ```javascript 224 | // bad 225 | const len = items.length; 226 | const itemsCopy = []; 227 | let i; 228 | 229 | for (i = 0; i < len; i++) { 230 | itemsCopy[i] = items[i]; 231 | } 232 | 233 | // good 234 | const itemsCopy = [...items]; 235 | ``` 236 | 237 | 使用Array.from方法,将类似数组的对象转为数组。 238 | 239 | ```javascript 240 | const foo = document.querySelectorAll('.foo'); 241 | const nodes = Array.from(foo); 242 | ``` 243 | 244 | ## 函数 245 | 246 | 立即执行函数可以写成箭头函数的形式。 247 | 248 | ```javascript 249 | (() => { 250 | console.log('Welcome to the Internet.'); 251 | })(); 252 | ``` 253 | 254 | 那些需要使用函数表达式的场合,尽量用箭头函数代替。因为这样更简洁,而且绑定了this。 255 | 256 | ```javascript 257 | // bad 258 | [1, 2, 3].map(function (x) { 259 | return x * x; 260 | }); 261 | 262 | // good 263 | [1, 2, 3].map((x) => { 264 | return x * x; 265 | }); 266 | ``` 267 | 268 | 箭头函数取代Function.prototype.bind,不应再用self/\_this/that绑定 this。 269 | 270 | ```javascript 271 | // bad 272 | const self = this; 273 | const boundMethod = function(...params) { 274 | return method.apply(self, params); 275 | } 276 | 277 | // acceptable 278 | const boundMethod = method.bind(this); 279 | 280 | // best 281 | const boundMethod = (...params) => method.apply(this, params); 282 | ``` 283 | 284 | 所有配置项都应该集中在一个对象,放在最后一个参数,布尔值不可以直接作为参数。 285 | 286 | ```bash 287 | // bad 288 | function divide(a, b, option = false ) { 289 | } 290 | 291 | // good 292 | function divide(a, b, { option = false } = {}) { 293 | } 294 | ``` 295 | 296 | 不要在函数体内使用arguments变量,使用rest运算符(...)代替。因为rest运算符显式表明你想要获取参数,而且arguments是一个类似数组的对象,而rest运算符可以提供一个真正的数组。 297 | 298 | ```javascript 299 | // bad 300 | function concatenateAll() { 301 | const args = Array.prototype.slice.call(arguments); 302 | return args.join(''); 303 | } 304 | 305 | // good 306 | function concatenateAll(...args) { 307 | return args.join(''); 308 | } 309 | ``` 310 | 311 | 使用默认值语法设置函数参数的默认值。 312 | 313 | ```javascript 314 | // bad 315 | function handleThings(opts) { 316 | opts = opts || {}; 317 | } 318 | 319 | // good 320 | function handleThings(opts = {}) { 321 | // ... 322 | } 323 | ``` 324 | 325 | ## Map结构 326 | 327 | 注意区分Object和Map,只有模拟实体对象时,才使用Object。如果只是需要key:value的数据结构,使用Map。因为Map有内建的遍历机制。 328 | 329 | ```javascript 330 | let map = new Map(arr); 331 | 332 | for (let key of map.keys()) { 333 | console.log(key); 334 | } 335 | 336 | for (let value of map.values()) { 337 | console.log(value); 338 | } 339 | 340 | for (let item of map.entries()) { 341 | console.log(item[0], item[1]); 342 | } 343 | ``` 344 | 345 | ## Class 346 | 347 | 总是用class,取代需要prototype操作。因为class的写法更简洁,更易于理解。 348 | 349 | ```javascript 350 | // bad 351 | function Queue(contents = []) { 352 | this._queue = [...contents]; 353 | } 354 | Queue.prototype.pop = function() { 355 | const value = this._queue[0]; 356 | this._queue.splice(0, 1); 357 | return value; 358 | } 359 | 360 | // good 361 | class Queue { 362 | constructor(contents = []) { 363 | this._queue = [...contents]; 364 | } 365 | pop() { 366 | const value = this._queue[0]; 367 | this._queue.splice(0, 1); 368 | return value; 369 | } 370 | } 371 | ``` 372 | 373 | 使用extends实现继承,因为这样更简单,不会有破坏instanceof运算的危险。 374 | 375 | ```javascript 376 | // bad 377 | const inherits = require('inherits'); 378 | function PeekableQueue(contents) { 379 | Queue.apply(this, contents); 380 | } 381 | inherits(PeekableQueue, Queue); 382 | PeekableQueue.prototype.peek = function() { 383 | return this._queue[0]; 384 | } 385 | 386 | // good 387 | class PeekableQueue extends Queue { 388 | peek() { 389 | return this._queue[0]; 390 | } 391 | } 392 | ``` 393 | 394 | ## 模块 395 | 396 | 首先,Module语法是JavaScript模块的标准写法,坚持使用这种写法。使用import取代require。 397 | 398 | ```javascript 399 | // bad 400 | const moduleA = require('moduleA'); 401 | const func1 = moduleA.func1; 402 | const func2 = moduleA.func2; 403 | 404 | // good 405 | import { func1, func2 } from 'moduleA'; 406 | ``` 407 | 408 | 使用export取代module.exports。 409 | 410 | ```javascript 411 | // commonJS的写法 412 | var React = require('react'); 413 | 414 | var Breadcrumbs = React.createClass({ 415 | render() { 416 | return