From 6ad3182d84362cdf6941839d700f28df58469ba9 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Sun, 20 Apr 2014 22:44:19 +0800 Subject: [PATCH] edit index.html --- app/bower_components/marked/.bower.json | 15 + app/bower_components/marked/.gitignore | 1 + app/bower_components/marked/.npmignore | 2 + app/bower_components/marked/.travis.yml | 5 + app/bower_components/marked/LICENSE | 19 + app/bower_components/marked/Makefile | 12 + app/bower_components/marked/README.md | 386 +++++ app/bower_components/marked/bin/marked | 187 +++ app/bower_components/marked/component.json | 10 + app/bower_components/marked/doc/broken.md | 426 ++++++ app/bower_components/marked/doc/todo.md | 2 + app/bower_components/marked/index.js | 1 + app/bower_components/marked/lib/marked.js | 1266 +++++++++++++++++ app/bower_components/marked/man/marked.1 | 88 ++ app/bower_components/marked/package.json | 22 + app/bower_components/marked/test/README | 10 + .../marked/test/browser/index.html | 5 + .../marked/test/browser/index.js | 41 + .../marked/test/browser/test.js | 62 + app/bower_components/marked/test/index.js | 543 +++++++ .../marked/test/new/autolink_lines.html | 3 + .../marked/test/new/autolink_lines.text | 2 + .../marked/test/new/blockquote_list_item.html | 3 + .../marked/test/new/blockquote_list_item.text | 4 + .../test/new/case_insensitive_refs.html | 1 + .../test/new/case_insensitive_refs.text | 3 + .../marked/test/new/def_blocks.html | 28 + .../marked/test/new/def_blocks.text | 21 + .../marked/test/new/double_link.html | 5 + .../marked/test/new/double_link.text | 5 + .../marked/test/new/escaped_angles.html | 1 + .../marked/test/new/escaped_angles.text | 1 + .../marked/test/new/gfm_break.breaks.html | 1 + .../marked/test/new/gfm_break.breaks.text | 3 + .../marked/test/new/gfm_code.html | 5 + .../marked/test/new/gfm_code.text | 16 + .../marked/test/new/gfm_code_hr_list.html | 52 + .../marked/test/new/gfm_code_hr_list.text | 53 + .../marked/test/new/gfm_del.html | 1 + .../marked/test/new/gfm_del.text | 1 + .../marked/test/new/gfm_em.html | 1 + .../marked/test/new/gfm_em.text | 1 + .../marked/test/new/gfm_links.html | 2 + .../marked/test/new/gfm_links.text | 1 + .../marked/test/new/gfm_tables.html | 37 + .../marked/test/new/gfm_tables.text | 21 + .../marked/test/new/hr_list_break.html | 10 + .../marked/test/new/hr_list_break.text | 6 + .../marked/test/new/lazy_blockquotes.html | 4 + .../marked/test/new/lazy_blockquotes.text | 2 + .../marked/test/new/list_item_text.html | 1 + .../marked/test/new/list_item_text.text | 5 + .../marked/test/new/loose_lists.html | 62 + .../marked/test/new/loose_lists.text | 59 + .../marked/test/new/main.html | 4 + .../marked/test/new/main.text | 55 + .../marked/test/new/nested_code.html | 1 + .../marked/test/new/nested_code.text | 1 + .../marked/test/new/nested_em.html | 3 + .../marked/test/new/nested_em.text | 3 + .../marked/test/new/nested_square_link.html | 1 + .../marked/test/new/nested_square_link.text | 1 + .../marked/test/new/not_a_link.html | 1 + .../marked/test/new/not_a_link.text | 1 + .../marked/test/new/ref_paren.html | 1 + .../marked/test/new/ref_paren.text | 3 + .../marked/test/new/same_bullet.html | 5 + .../marked/test/new/same_bullet.text | 3 + .../marked/test/new/text.smartypants.html | 6 + .../marked/test/new/text.smartypants.text | 6 + .../test/new/toplevel_paragraphs.gfm.html | 34 + .../test/new/toplevel_paragraphs.gfm.text | 37 + .../marked/test/new/tricky_list.html | 23 + .../marked/test/new/tricky_list.text | 15 + .../original/amps_and_angles_encoding.html | 17 + .../original/amps_and_angles_encoding.text | 21 + .../marked/test/original/auto_links.html | 18 + .../marked/test/original/auto_links.text | 13 + .../test/original/backslash_escapes.html | 118 ++ .../test/original/backslash_escapes.text | 120 ++ .../blockquotes_with_code_blocks.html | 15 + .../blockquotes_with_code_blocks.text | 11 + .../marked/test/original/code_blocks.html | 18 + .../marked/test/original/code_blocks.text | 14 + .../marked/test/original/code_spans.html | 6 + .../marked/test/original/code_spans.text | 6 + ...apped_paragraphs_with_list_like_lines.html | 8 + ...apped_paragraphs_with_list_like_lines.text | 8 + .../test/original/horizontal_rules.html | 71 + .../test/original/horizontal_rules.text | 67 + .../test/original/inline_html_advanced.html | 15 + .../test/original/inline_html_advanced.text | 15 + .../test/original/inline_html_comments.html | 13 + .../test/original/inline_html_comments.text | 13 + .../test/original/inline_html_simple.html | 72 + .../test/original/inline_html_simple.text | 69 + .../test/original/links_inline_style.html | 15 + .../test/original/links_inline_style.text | 15 + .../test/original/links_reference_style.html | 52 + .../test/original/links_reference_style.text | 71 + .../original/links_shortcut_references.html | 9 + .../original/links_shortcut_references.text | 20 + .../original/literal_quotes_in_titles.html | 3 + .../original/literal_quotes_in_titles.text | 7 + .../markdown_documentation_basics.html | 314 ++++ .../markdown_documentation_basics.text | 306 ++++ .../markdown_documentation_syntax.html | 942 ++++++++++++ .../markdown_documentation_syntax.text | 888 ++++++++++++ .../test/original/nested_blockquotes.html | 9 + .../test/original/nested_blockquotes.text | 5 + .../original/ordered_and_unordered_lists.html | 148 ++ .../original/ordered_and_unordered_lists.text | 131 ++ .../test/original/strong_and_em_together.html | 7 + .../test/original/strong_and_em_together.text | 7 + .../marked/test/original/tabs.html | 25 + .../marked/test/original/tabs.text | 21 + .../marked/test/original/tidyness.html | 8 + .../marked/test/original/tidyness.text | 5 + .../test/tests/amps_and_angles_encoding.html | 17 + .../test/tests/amps_and_angles_encoding.text | 21 + .../marked/test/tests/auto_links.html | 18 + .../marked/test/tests/auto_links.text | 13 + .../marked/test/tests/autolink_lines.html | 3 + .../marked/test/tests/autolink_lines.text | 2 + .../marked/test/tests/backslash_escapes.html | 118 ++ .../marked/test/tests/backslash_escapes.text | 120 ++ .../test/tests/blockquote_list_item.html | 3 + .../test/tests/blockquote_list_item.text | 4 + .../tests/blockquotes_with_code_blocks.html | 15 + .../tests/blockquotes_with_code_blocks.text | 11 + .../test/tests/case_insensitive_refs.html | 1 + .../test/tests/case_insensitive_refs.text | 3 + .../marked/test/tests/code_blocks.html | 18 + .../marked/test/tests/code_blocks.text | 14 + .../marked/test/tests/code_spans.html | 6 + .../marked/test/tests/code_spans.text | 6 + .../marked/test/tests/def_blocks.html | 28 + .../marked/test/tests/def_blocks.text | 21 + .../marked/test/tests/double_link.html | 5 + .../marked/test/tests/double_link.text | 5 + .../marked/test/tests/escaped_angles.html | 1 + .../marked/test/tests/escaped_angles.text | 1 + .../marked/test/tests/gfm_break.breaks.html | 1 + .../marked/test/tests/gfm_break.breaks.text | 3 + .../marked/test/tests/gfm_code.html | 5 + .../marked/test/tests/gfm_code.text | 16 + .../marked/test/tests/gfm_code_hr_list.html | 52 + .../marked/test/tests/gfm_code_hr_list.text | 53 + .../marked/test/tests/gfm_del.html | 1 + .../marked/test/tests/gfm_del.text | 1 + .../marked/test/tests/gfm_em.html | 1 + .../marked/test/tests/gfm_em.text | 1 + .../marked/test/tests/gfm_links.html | 2 + .../marked/test/tests/gfm_links.text | 1 + .../marked/test/tests/gfm_tables.html | 37 + .../marked/test/tests/gfm_tables.text | 21 + ...paragraphs_with_list_like_lines.nogfm.html | 8 + ...paragraphs_with_list_like_lines.nogfm.text | 8 + .../marked/test/tests/horizontal_rules.html | 71 + .../marked/test/tests/horizontal_rules.text | 67 + .../marked/test/tests/hr_list_break.html | 10 + .../marked/test/tests/hr_list_break.text | 6 + .../test/tests/inline_html_advanced.html | 15 + .../test/tests/inline_html_advanced.text | 15 + .../test/tests/inline_html_comments.html | 13 + .../test/tests/inline_html_comments.text | 13 + .../marked/test/tests/inline_html_simple.html | 72 + .../marked/test/tests/inline_html_simple.text | 69 + .../marked/test/tests/lazy_blockquotes.html | 4 + .../marked/test/tests/lazy_blockquotes.text | 2 + .../marked/test/tests/links_inline_style.html | 15 + .../marked/test/tests/links_inline_style.text | 15 + .../test/tests/links_reference_style.html | 52 + .../test/tests/links_reference_style.text | 71 + .../test/tests/links_shortcut_references.html | 9 + .../test/tests/links_shortcut_references.text | 20 + .../marked/test/tests/list_item_text.html | 1 + .../marked/test/tests/list_item_text.text | 5 + .../test/tests/literal_quotes_in_titles.html | 3 + .../test/tests/literal_quotes_in_titles.text | 7 + .../marked/test/tests/loose_lists.html | 62 + .../marked/test/tests/loose_lists.text | 59 + .../marked/test/tests/main.html | 4 + .../marked/test/tests/main.text | 55 + .../tests/markdown_documentation_basics.html | 314 ++++ .../tests/markdown_documentation_basics.text | 306 ++++ .../tests/markdown_documentation_syntax.html | 942 ++++++++++++ .../tests/markdown_documentation_syntax.text | 888 ++++++++++++ .../marked/test/tests/nested_blockquotes.html | 9 + .../marked/test/tests/nested_blockquotes.text | 5 + .../marked/test/tests/nested_code.html | 1 + .../marked/test/tests/nested_code.text | 1 + .../marked/test/tests/nested_em.html | 3 + .../marked/test/tests/nested_em.text | 3 + .../marked/test/tests/nested_square_link.html | 1 + .../marked/test/tests/nested_square_link.text | 1 + .../marked/test/tests/not_a_link.html | 1 + .../marked/test/tests/not_a_link.text | 1 + .../tests/ordered_and_unordered_lists.html | 148 ++ .../tests/ordered_and_unordered_lists.text | 131 ++ .../marked/test/tests/ref_paren.html | 1 + .../marked/test/tests/ref_paren.text | 3 + .../marked/test/tests/same_bullet.html | 5 + .../marked/test/tests/same_bullet.text | 3 + .../test/tests/strong_and_em_together.html | 7 + .../test/tests/strong_and_em_together.text | 7 + .../marked/test/tests/tabs.html | 25 + .../marked/test/tests/tabs.text | 21 + .../marked/test/tests/text.smartypants.html | 6 + .../marked/test/tests/text.smartypants.text | 6 + .../marked/test/tests/tidyness.html | 8 + .../marked/test/tests/tidyness.text | 5 + .../test/tests/toplevel_paragraphs.gfm.html | 34 + .../test/tests/toplevel_paragraphs.gfm.text | 37 + .../marked/test/tests/tricky_list.html | 23 + .../marked/test/tests/tricky_list.text | 15 + index.html | 7 +- js/ditto.js | 197 +++ js/marked.js | 1 + 219 files changed, 12025 insertions(+), 5 deletions(-) create mode 100644 app/bower_components/marked/.bower.json create mode 100644 app/bower_components/marked/.gitignore create mode 100644 app/bower_components/marked/.npmignore create mode 100644 app/bower_components/marked/.travis.yml create mode 100644 app/bower_components/marked/LICENSE create mode 100644 app/bower_components/marked/Makefile create mode 100644 app/bower_components/marked/README.md create mode 100755 app/bower_components/marked/bin/marked create mode 100644 app/bower_components/marked/component.json create mode 100644 app/bower_components/marked/doc/broken.md create mode 100644 app/bower_components/marked/doc/todo.md create mode 100644 app/bower_components/marked/index.js create mode 100644 app/bower_components/marked/lib/marked.js create mode 100644 app/bower_components/marked/man/marked.1 create mode 100644 app/bower_components/marked/package.json create mode 100644 app/bower_components/marked/test/README create mode 100644 app/bower_components/marked/test/browser/index.html create mode 100644 app/bower_components/marked/test/browser/index.js create mode 100644 app/bower_components/marked/test/browser/test.js create mode 100644 app/bower_components/marked/test/index.js create mode 100644 app/bower_components/marked/test/new/autolink_lines.html create mode 100644 app/bower_components/marked/test/new/autolink_lines.text create mode 100644 app/bower_components/marked/test/new/blockquote_list_item.html create mode 100644 app/bower_components/marked/test/new/blockquote_list_item.text create mode 100644 app/bower_components/marked/test/new/case_insensitive_refs.html create mode 100644 app/bower_components/marked/test/new/case_insensitive_refs.text create mode 100644 app/bower_components/marked/test/new/def_blocks.html create mode 100644 app/bower_components/marked/test/new/def_blocks.text create mode 100644 app/bower_components/marked/test/new/double_link.html create mode 100644 app/bower_components/marked/test/new/double_link.text create mode 100644 app/bower_components/marked/test/new/escaped_angles.html create mode 100644 app/bower_components/marked/test/new/escaped_angles.text create mode 100644 app/bower_components/marked/test/new/gfm_break.breaks.html create mode 100644 app/bower_components/marked/test/new/gfm_break.breaks.text create mode 100644 app/bower_components/marked/test/new/gfm_code.html create mode 100644 app/bower_components/marked/test/new/gfm_code.text create mode 100644 app/bower_components/marked/test/new/gfm_code_hr_list.html create mode 100644 app/bower_components/marked/test/new/gfm_code_hr_list.text create mode 100644 app/bower_components/marked/test/new/gfm_del.html create mode 100644 app/bower_components/marked/test/new/gfm_del.text create mode 100644 app/bower_components/marked/test/new/gfm_em.html create mode 100644 app/bower_components/marked/test/new/gfm_em.text create mode 100644 app/bower_components/marked/test/new/gfm_links.html create mode 100644 app/bower_components/marked/test/new/gfm_links.text create mode 100644 app/bower_components/marked/test/new/gfm_tables.html create mode 100644 app/bower_components/marked/test/new/gfm_tables.text create mode 100644 app/bower_components/marked/test/new/hr_list_break.html create mode 100644 app/bower_components/marked/test/new/hr_list_break.text create mode 100644 app/bower_components/marked/test/new/lazy_blockquotes.html create mode 100644 app/bower_components/marked/test/new/lazy_blockquotes.text create mode 100644 app/bower_components/marked/test/new/list_item_text.html create mode 100644 app/bower_components/marked/test/new/list_item_text.text create mode 100644 app/bower_components/marked/test/new/loose_lists.html create mode 100644 app/bower_components/marked/test/new/loose_lists.text create mode 100644 app/bower_components/marked/test/new/main.html create mode 100644 app/bower_components/marked/test/new/main.text create mode 100644 app/bower_components/marked/test/new/nested_code.html create mode 100644 app/bower_components/marked/test/new/nested_code.text create mode 100644 app/bower_components/marked/test/new/nested_em.html create mode 100644 app/bower_components/marked/test/new/nested_em.text create mode 100644 app/bower_components/marked/test/new/nested_square_link.html create mode 100644 app/bower_components/marked/test/new/nested_square_link.text create mode 100644 app/bower_components/marked/test/new/not_a_link.html create mode 100644 app/bower_components/marked/test/new/not_a_link.text create mode 100644 app/bower_components/marked/test/new/ref_paren.html create mode 100644 app/bower_components/marked/test/new/ref_paren.text create mode 100644 app/bower_components/marked/test/new/same_bullet.html create mode 100644 app/bower_components/marked/test/new/same_bullet.text create mode 100644 app/bower_components/marked/test/new/text.smartypants.html create mode 100644 app/bower_components/marked/test/new/text.smartypants.text create mode 100644 app/bower_components/marked/test/new/toplevel_paragraphs.gfm.html create mode 100644 app/bower_components/marked/test/new/toplevel_paragraphs.gfm.text create mode 100644 app/bower_components/marked/test/new/tricky_list.html create mode 100644 app/bower_components/marked/test/new/tricky_list.text create mode 100644 app/bower_components/marked/test/original/amps_and_angles_encoding.html create mode 100644 app/bower_components/marked/test/original/amps_and_angles_encoding.text create mode 100644 app/bower_components/marked/test/original/auto_links.html create mode 100644 app/bower_components/marked/test/original/auto_links.text create mode 100644 app/bower_components/marked/test/original/backslash_escapes.html create mode 100644 app/bower_components/marked/test/original/backslash_escapes.text create mode 100644 app/bower_components/marked/test/original/blockquotes_with_code_blocks.html create mode 100644 app/bower_components/marked/test/original/blockquotes_with_code_blocks.text create mode 100644 app/bower_components/marked/test/original/code_blocks.html create mode 100644 app/bower_components/marked/test/original/code_blocks.text create mode 100644 app/bower_components/marked/test/original/code_spans.html create mode 100644 app/bower_components/marked/test/original/code_spans.text create mode 100644 app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.html create mode 100644 app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.text create mode 100644 app/bower_components/marked/test/original/horizontal_rules.html create mode 100644 app/bower_components/marked/test/original/horizontal_rules.text create mode 100644 app/bower_components/marked/test/original/inline_html_advanced.html create mode 100644 app/bower_components/marked/test/original/inline_html_advanced.text create mode 100644 app/bower_components/marked/test/original/inline_html_comments.html create mode 100644 app/bower_components/marked/test/original/inline_html_comments.text create mode 100644 app/bower_components/marked/test/original/inline_html_simple.html create mode 100644 app/bower_components/marked/test/original/inline_html_simple.text create mode 100644 app/bower_components/marked/test/original/links_inline_style.html create mode 100644 app/bower_components/marked/test/original/links_inline_style.text create mode 100644 app/bower_components/marked/test/original/links_reference_style.html create mode 100644 app/bower_components/marked/test/original/links_reference_style.text create mode 100644 app/bower_components/marked/test/original/links_shortcut_references.html create mode 100644 app/bower_components/marked/test/original/links_shortcut_references.text create mode 100644 app/bower_components/marked/test/original/literal_quotes_in_titles.html create mode 100644 app/bower_components/marked/test/original/literal_quotes_in_titles.text create mode 100644 app/bower_components/marked/test/original/markdown_documentation_basics.html create mode 100644 app/bower_components/marked/test/original/markdown_documentation_basics.text create mode 100644 app/bower_components/marked/test/original/markdown_documentation_syntax.html create mode 100644 app/bower_components/marked/test/original/markdown_documentation_syntax.text create mode 100644 app/bower_components/marked/test/original/nested_blockquotes.html create mode 100644 app/bower_components/marked/test/original/nested_blockquotes.text create mode 100644 app/bower_components/marked/test/original/ordered_and_unordered_lists.html create mode 100644 app/bower_components/marked/test/original/ordered_and_unordered_lists.text create mode 100644 app/bower_components/marked/test/original/strong_and_em_together.html create mode 100644 app/bower_components/marked/test/original/strong_and_em_together.text create mode 100644 app/bower_components/marked/test/original/tabs.html create mode 100644 app/bower_components/marked/test/original/tabs.text create mode 100644 app/bower_components/marked/test/original/tidyness.html create mode 100644 app/bower_components/marked/test/original/tidyness.text create mode 100644 app/bower_components/marked/test/tests/amps_and_angles_encoding.html create mode 100644 app/bower_components/marked/test/tests/amps_and_angles_encoding.text create mode 100644 app/bower_components/marked/test/tests/auto_links.html create mode 100644 app/bower_components/marked/test/tests/auto_links.text create mode 100644 app/bower_components/marked/test/tests/autolink_lines.html create mode 100644 app/bower_components/marked/test/tests/autolink_lines.text create mode 100644 app/bower_components/marked/test/tests/backslash_escapes.html create mode 100644 app/bower_components/marked/test/tests/backslash_escapes.text create mode 100644 app/bower_components/marked/test/tests/blockquote_list_item.html create mode 100644 app/bower_components/marked/test/tests/blockquote_list_item.text create mode 100644 app/bower_components/marked/test/tests/blockquotes_with_code_blocks.html create mode 100644 app/bower_components/marked/test/tests/blockquotes_with_code_blocks.text create mode 100644 app/bower_components/marked/test/tests/case_insensitive_refs.html create mode 100644 app/bower_components/marked/test/tests/case_insensitive_refs.text create mode 100644 app/bower_components/marked/test/tests/code_blocks.html create mode 100644 app/bower_components/marked/test/tests/code_blocks.text create mode 100644 app/bower_components/marked/test/tests/code_spans.html create mode 100644 app/bower_components/marked/test/tests/code_spans.text create mode 100644 app/bower_components/marked/test/tests/def_blocks.html create mode 100644 app/bower_components/marked/test/tests/def_blocks.text create mode 100644 app/bower_components/marked/test/tests/double_link.html create mode 100644 app/bower_components/marked/test/tests/double_link.text create mode 100644 app/bower_components/marked/test/tests/escaped_angles.html create mode 100644 app/bower_components/marked/test/tests/escaped_angles.text create mode 100644 app/bower_components/marked/test/tests/gfm_break.breaks.html create mode 100644 app/bower_components/marked/test/tests/gfm_break.breaks.text create mode 100644 app/bower_components/marked/test/tests/gfm_code.html create mode 100644 app/bower_components/marked/test/tests/gfm_code.text create mode 100644 app/bower_components/marked/test/tests/gfm_code_hr_list.html create mode 100644 app/bower_components/marked/test/tests/gfm_code_hr_list.text create mode 100644 app/bower_components/marked/test/tests/gfm_del.html create mode 100644 app/bower_components/marked/test/tests/gfm_del.text create mode 100644 app/bower_components/marked/test/tests/gfm_em.html create mode 100644 app/bower_components/marked/test/tests/gfm_em.text create mode 100644 app/bower_components/marked/test/tests/gfm_links.html create mode 100644 app/bower_components/marked/test/tests/gfm_links.text create mode 100644 app/bower_components/marked/test/tests/gfm_tables.html create mode 100644 app/bower_components/marked/test/tests/gfm_tables.text create mode 100644 app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html create mode 100644 app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text create mode 100644 app/bower_components/marked/test/tests/horizontal_rules.html create mode 100644 app/bower_components/marked/test/tests/horizontal_rules.text create mode 100644 app/bower_components/marked/test/tests/hr_list_break.html create mode 100644 app/bower_components/marked/test/tests/hr_list_break.text create mode 100644 app/bower_components/marked/test/tests/inline_html_advanced.html create mode 100644 app/bower_components/marked/test/tests/inline_html_advanced.text create mode 100644 app/bower_components/marked/test/tests/inline_html_comments.html create mode 100644 app/bower_components/marked/test/tests/inline_html_comments.text create mode 100644 app/bower_components/marked/test/tests/inline_html_simple.html create mode 100644 app/bower_components/marked/test/tests/inline_html_simple.text create mode 100644 app/bower_components/marked/test/tests/lazy_blockquotes.html create mode 100644 app/bower_components/marked/test/tests/lazy_blockquotes.text create mode 100644 app/bower_components/marked/test/tests/links_inline_style.html create mode 100644 app/bower_components/marked/test/tests/links_inline_style.text create mode 100644 app/bower_components/marked/test/tests/links_reference_style.html create mode 100644 app/bower_components/marked/test/tests/links_reference_style.text create mode 100644 app/bower_components/marked/test/tests/links_shortcut_references.html create mode 100644 app/bower_components/marked/test/tests/links_shortcut_references.text create mode 100644 app/bower_components/marked/test/tests/list_item_text.html create mode 100644 app/bower_components/marked/test/tests/list_item_text.text create mode 100644 app/bower_components/marked/test/tests/literal_quotes_in_titles.html create mode 100644 app/bower_components/marked/test/tests/literal_quotes_in_titles.text create mode 100644 app/bower_components/marked/test/tests/loose_lists.html create mode 100644 app/bower_components/marked/test/tests/loose_lists.text create mode 100644 app/bower_components/marked/test/tests/main.html create mode 100644 app/bower_components/marked/test/tests/main.text create mode 100644 app/bower_components/marked/test/tests/markdown_documentation_basics.html create mode 100644 app/bower_components/marked/test/tests/markdown_documentation_basics.text create mode 100644 app/bower_components/marked/test/tests/markdown_documentation_syntax.html create mode 100644 app/bower_components/marked/test/tests/markdown_documentation_syntax.text create mode 100644 app/bower_components/marked/test/tests/nested_blockquotes.html create mode 100644 app/bower_components/marked/test/tests/nested_blockquotes.text create mode 100644 app/bower_components/marked/test/tests/nested_code.html create mode 100644 app/bower_components/marked/test/tests/nested_code.text create mode 100644 app/bower_components/marked/test/tests/nested_em.html create mode 100644 app/bower_components/marked/test/tests/nested_em.text create mode 100644 app/bower_components/marked/test/tests/nested_square_link.html create mode 100644 app/bower_components/marked/test/tests/nested_square_link.text create mode 100644 app/bower_components/marked/test/tests/not_a_link.html create mode 100644 app/bower_components/marked/test/tests/not_a_link.text create mode 100644 app/bower_components/marked/test/tests/ordered_and_unordered_lists.html create mode 100644 app/bower_components/marked/test/tests/ordered_and_unordered_lists.text create mode 100644 app/bower_components/marked/test/tests/ref_paren.html create mode 100644 app/bower_components/marked/test/tests/ref_paren.text create mode 100644 app/bower_components/marked/test/tests/same_bullet.html create mode 100644 app/bower_components/marked/test/tests/same_bullet.text create mode 100644 app/bower_components/marked/test/tests/strong_and_em_together.html create mode 100644 app/bower_components/marked/test/tests/strong_and_em_together.text create mode 100644 app/bower_components/marked/test/tests/tabs.html create mode 100644 app/bower_components/marked/test/tests/tabs.text create mode 100644 app/bower_components/marked/test/tests/text.smartypants.html create mode 100644 app/bower_components/marked/test/tests/text.smartypants.text create mode 100644 app/bower_components/marked/test/tests/tidyness.html create mode 100644 app/bower_components/marked/test/tests/tidyness.text create mode 100644 app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.html create mode 100644 app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.text create mode 100644 app/bower_components/marked/test/tests/tricky_list.html create mode 100644 app/bower_components/marked/test/tests/tricky_list.text create mode 100644 js/ditto.js create mode 100644 js/marked.js diff --git a/app/bower_components/marked/.bower.json b/app/bower_components/marked/.bower.json new file mode 100644 index 000000000..6b94508ed --- /dev/null +++ b/app/bower_components/marked/.bower.json @@ -0,0 +1,15 @@ +{ + "name": "marked", + "homepage": "https://github.com/chjj/marked", + "version": "0.3.2", + "_release": "0.3.2", + "_resolution": { + "type": "version", + "tag": "v0.3.2", + "commit": "43db549e31af5ff6e4a3b12e41a23513b9f88c99" + }, + "_source": "git://github.com/chjj/marked.git", + "_target": "~0.3.2", + "_originalSource": "marked", + "_direct": true +} \ No newline at end of file diff --git a/app/bower_components/marked/.gitignore b/app/bower_components/marked/.gitignore new file mode 100644 index 000000000..c2658d7d1 --- /dev/null +++ b/app/bower_components/marked/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/app/bower_components/marked/.npmignore b/app/bower_components/marked/.npmignore new file mode 100644 index 000000000..3fb773c03 --- /dev/null +++ b/app/bower_components/marked/.npmignore @@ -0,0 +1,2 @@ +.git* +test/ diff --git a/app/bower_components/marked/.travis.yml b/app/bower_components/marked/.travis.yml new file mode 100644 index 000000000..60d00ce14 --- /dev/null +++ b/app/bower_components/marked/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.8" + - "0.6" diff --git a/app/bower_components/marked/LICENSE b/app/bower_components/marked/LICENSE new file mode 100644 index 000000000..a7b812ed6 --- /dev/null +++ b/app/bower_components/marked/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/app/bower_components/marked/Makefile b/app/bower_components/marked/Makefile new file mode 100644 index 000000000..20ac2d40d --- /dev/null +++ b/app/bower_components/marked/Makefile @@ -0,0 +1,12 @@ +all: + @cp lib/marked.js marked.js + @uglifyjs -o marked.min.js marked.js + +clean: + @rm marked.js + @rm marked.min.js + +bench: + @node test --bench + +.PHONY: clean all diff --git a/app/bower_components/marked/README.md b/app/bower_components/marked/README.md new file mode 100644 index 000000000..441c1eb05 --- /dev/null +++ b/app/bower_components/marked/README.md @@ -0,0 +1,386 @@ +# marked + +> A full-featured markdown parser and compiler, written in JavaScript. Built +> for speed. + +[![NPM version](https://badge.fury.io/js/marked.png)][badge] + +## Install + +``` bash +npm install marked --save +``` + +## Usage + +Minimal usage: + +```js +var marked = require('marked'); +console.log(marked('I am using __markdown__.')); +// Outputs:

I am using markdown.

+``` + +Example setting options with default values: + +```js +var marked = require('marked'); +marked.setOptions({ + renderer: new marked.Renderer(), + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: true, + smartLists: true, + smartypants: false +}); + +console.log(marked('I am using __markdown__.')); +``` + +## marked(markdownString [,options] [,callback]) + +### markdownString + +Type: `string` + +String of markdown source to be compiled. + +### options + +Type: `object` + +Hash of options. Can also be set using the `marked.setOptions` method as seen +above. + +### callback + +Type: `function` + +Function called when the `markdownString` has been fully parsed when using +async highlighting. If the `options` argument is omitted, this can be used as +the second argument. + +## Options + +### highlight + +Type: `function` + +A function to highlight code blocks. The first example below uses async highlighting with +[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using +[highlight.js][highlight]: + +```js +var marked = require('marked'); + +var markdownString = '```js\n console.log("hello"); \n```'; + +// Async highlighting with pygmentize-bundled +marked.setOptions({ + highlight: function (code, lang, callback) { + require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { + callback(err, result.toString()); + }); + } +}); + +// Using async version of marked +marked(markdownString, function (err, content) { + if (err) throw err; + console.log(content); +}); + +// Synchronous highlighting with highlight.js +marked.setOptions({ + highlight: function (code) { + return require('highlight.js').highlightAuto(code).value; + } +}); + +console.log(marked(markdownString)); +``` + +#### highlight arguments + +`code` + +Type: `string` + +The section of code to pass to the highlighter. + +`lang` + +Type: `string` + +The programming language specified in the code block. + +`callback` + +Type: `function` + +The callback function to call when using an async highlighter. + +### renderer + +Type: `object` +Default: `new Renderer()` + +An object containing functions to render tokens to HTML. + +#### Overriding renderer methods + +The renderer option allows you to render tokens in a custom manor. Here is an +example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: + +```javascript +var marked = require('marked'); +var renderer = new marked.Renderer(); + +renderer.heading = function (text, level) { + var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); + + return '' + + text + ''; +}, + +console.log(marked('# heading+', { renderer: renderer })); +``` +This code will output the following HTML: +```html +

+ + + + heading+ +

+``` + +#### Block level renderer methods + +- code(*string* code, *string* language) +- blockquote(*string* quote) +- html(*string* html) +- heading(*string* text, *number* level) +- hr() +- list(*string* body, *boolean* ordered) +- listitem(*string* text) +- paragraph(*string* text) +- table(*string* header, *string* body) +- tablerow(*string* content) +- tablecell(*string* content, *object* flags) + +`flags` has the following properties: + +```js +{ + header: true || false, + align: 'center' || 'left' || 'right' +} +``` + +#### Inline level renderer methods + +- strong(*string* text) +- em(*string* text) +- codespan(*string* code) +- br() +- del(*string* text) +- link(*string* href, *string* title, *string* text) +- image(*string* href, *string* title, *string* text) + +### gfm + +Type: `boolean` +Default: `true` + +Enable [GitHub flavored markdown][gfm]. + +### tables + +Type: `boolean` +Default: `true` + +Enable GFM [tables][tables]. +This option requires the `gfm` option to be true. + +### breaks + +Type: `boolean` +Default: `false` + +Enable GFM [line breaks][breaks]. +This option requires the `gfm` option to be true. + +### pedantic + +Type: `boolean` +Default: `false` + +Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of +the original markdown bugs or poor behavior. + +### sanitize + +Type: `boolean` +Default: `false` + +Sanitize the output. Ignore any HTML that has been input. + +### smartLists + +Type: `boolean` +Default: `true` + +Use smarter list behavior than the original markdown. May eventually be +default with the old behavior moved into `pedantic`. + +### smartypants + +Type: `boolean` +Default: `false` + +Use "smart" typograhic punctuation for things like quotes and dashes. + +## Access to lexer and parser + +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +## CLI + +``` bash +$ marked -o hello.html +hello world +^D +$ cat hello.html +

hello world

+``` + +## Philosophy behind marked + +The point of marked was to create a markdown compiler where it was possible to +frequently parse huge chunks of markdown without having to worry about +caching the compiled output somehow...or blocking for an unnecesarily long time. + +marked is very concise and still implements all markdown features. It is also +now fully compatible with the client-side. + +marked more or less passes the official markdown test suite in its +entirety. This is important because a surprising number of markdown compilers +cannot pass more than a few tests. It was very difficult to get marked as +compliant as it is. It could have cut corners in several areas for the sake +of performance, but did not in order to be exactly what you expect in terms +of a markdown rendering. In fact, this is why marked could be considered at a +disadvantage in the benchmarks above. + +Along with implementing every markdown feature, marked also implements [GFM +features][gfmf]. + +## Benchmarks + +node v0.8.x + +``` bash +$ node test --bench +marked completed in 3411ms. +marked (gfm) completed in 3727ms. +marked (pedantic) completed in 3201ms. +robotskirt completed in 808ms. +showdown (reuse converter) completed in 11954ms. +showdown (new converter) completed in 17774ms. +markdown-js completed in 17191ms. +``` + +__Marked is now faster than Discount, which is written in C.__ + +For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. + +### Pro level + +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +``` bash +$ node +> require('marked').lexer('> i am using marked.') +[ { type: 'blockquote_start' }, + { type: 'paragraph', + text: 'i am using marked.' }, + { type: 'blockquote_end' }, + links: {} ] +``` + +## Running Tests & Contributing + +If you want to submit a pull request, make sure your changes pass the test +suite. If you're adding a new feature, be sure to add your own test. + +The marked test suite is set up slightly strangely: `test/new` is for all tests +that are not part of the original markdown.pl test suite (this is where your +test should go if you make one). `test/original` is only for the original +markdown.pl tests. `test/tests` houses both types of tests after they have been +combined and moved/generated by running `node test --fix` or `marked --test +--fix`. + +In other words, if you have a test to add, add it to `test/new/` and then +regenerate the tests with `node test --fix`. Commit the result. If your test +uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you +can add `.nogfm` to the filename. So, `my-test.text` becomes +`my-test.nogfm.text`. You can do this with any marked option. Say you want +line breaks and smartypants enabled, your filename should be: +`my-test.breaks.smartypants.text`. + +To run the tests: + +``` bash +cd marked/ +node test +``` + +### Contribution and License Agreement + +If you contribute code to this project, you are implicitly allowing your code +to be distributed under the MIT license. You are also implicitly verifying that +all code is your original work. `` + +## License + +Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) + +See LICENSE for more info. + +[gfm]: https://help.github.com/articles/github-flavored-markdown +[gfmf]: http://github.github.com/github-flavored-markdown/ +[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled +[highlight]: https://github.com/isagalaev/highlight.js +[badge]: http://badge.fury.io/js/marked +[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables +[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/app/bower_components/marked/bin/marked b/app/bower_components/marked/bin/marked new file mode 100755 index 000000000..64254fc3e --- /dev/null +++ b/app/bower_components/marked/bin/marked @@ -0,0 +1,187 @@ +#!/usr/bin/env node + +/** + * Marked CLI + * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) + */ + +var fs = require('fs') + , util = require('util') + , marked = require('../'); + +/** + * Man Page + */ + +function help() { + var spawn = require('child_process').spawn; + + var options = { + cwd: process.cwd(), + env: process.env, + setsid: false, + customFds: [0, 1, 2] + }; + + spawn('man', + [__dirname + '/../man/marked.1'], + options); +} + +/** + * Main + */ + +function main(argv, callback) { + var files = [] + , options = {} + , input + , output + , arg + , tokens + , opt; + + function getarg() { + var arg = argv.shift(); + + if (arg.indexOf('--') === 0) { + // e.g. --opt + arg = arg.split('='); + if (arg.length > 1) { + // e.g. --opt=val + argv.unshift(arg.slice(1).join('=')); + } + arg = arg[0]; + } else if (arg[0] === '-') { + if (arg.length > 2) { + // e.g. -abc + argv = arg.substring(1).split('').map(function(ch) { + return '-' + ch; + }).concat(argv); + arg = argv.shift(); + } else { + // e.g. -a + } + } else { + // e.g. foo + } + + return arg; + } + + while (argv.length) { + arg = getarg(); + switch (arg) { + case '--test': + return require('../test').main(process.argv.slice()); + case '-o': + case '--output': + output = argv.shift(); + break; + case '-i': + case '--input': + input = argv.shift(); + break; + case '-t': + case '--tokens': + tokens = true; + break; + case '-h': + case '--help': + return help(); + default: + if (arg.indexOf('--') === 0) { + opt = camelize(arg.replace(/^--(no-)?/, '')); + if (!marked.defaults.hasOwnProperty(opt)) { + continue; + } + if (arg.indexOf('--no-') === 0) { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? null + : false; + } else { + options[opt] = typeof marked.defaults[opt] !== 'boolean' + ? argv.shift() + : true; + } + } else { + files.push(arg); + } + break; + } + } + + function getData(callback) { + if (!input) { + if (files.length <= 2) { + return getStdin(callback); + } + input = files.pop(); + } + return fs.readFile(input, 'utf8', callback); + } + + return getData(function(err, data) { + if (err) return callback(err); + + data = tokens + ? JSON.stringify(marked.lexer(data, options), null, 2) + : marked(data, options); + + if (!output) { + process.stdout.write(data + '\n'); + return callback(); + } + + return fs.writeFile(output, data, callback); + }); +} + +/** + * Helpers + */ + +function getStdin(callback) { + var stdin = process.stdin + , buff = ''; + + stdin.setEncoding('utf8'); + + stdin.on('data', function(data) { + buff += data; + }); + + stdin.on('error', function(err) { + return callback(err); + }); + + stdin.on('end', function() { + return callback(null, buff); + }); + + try { + stdin.resume(); + } catch (e) { + callback(e); + } +} + +function camelize(text) { + return text.replace(/(\w)-(\w)/g, function(_, a, b) { + return a + b.toUpperCase(); + }); +} + +/** + * Expose / Entry Point + */ + +if (!module.parent) { + process.title = 'marked'; + main(process.argv.slice(), function(err, code) { + if (err) throw err; + return process.exit(code || 0); + }); +} else { + module.exports = main; +} diff --git a/app/bower_components/marked/component.json b/app/bower_components/marked/component.json new file mode 100644 index 000000000..931cbedcd --- /dev/null +++ b/app/bower_components/marked/component.json @@ -0,0 +1,10 @@ +{ + "name": "marked", + "version": "0.3.2", + "repo": "chjj/marked", + "description": "A markdown parser built for speed", + "keywords": ["markdown", "markup", "html"], + "scripts": ["lib/marked.js"], + "main": "lib/marked.js", + "license": "MIT" +} diff --git a/app/bower_components/marked/doc/broken.md b/app/bower_components/marked/doc/broken.md new file mode 100644 index 000000000..7bfa49e8a --- /dev/null +++ b/app/bower_components/marked/doc/broken.md @@ -0,0 +1,426 @@ +# Markdown is broken + +I have a lot of scraps of markdown engine oddities that I've collected over the +years. What you see below is slightly messy, but it's what I've managed to +cobble together to illustrate the differences between markdown engines, and +why, if there ever is a markdown specification, it has to be absolutely +thorough. There are a lot more of these little differences I have documented +elsewhere. I know I will find them lingering on my disk one day, but until +then, I'll continue to add whatever strange nonsensical things I find. + +Some of these examples may only mention a particular engine compared to marked. +However, the examples with markdown.pl could easily be swapped out for +discount, upskirt, or markdown.js, and you would very easily see even more +inconsistencies. + +A lot of this was written when I was very unsatisfied with the inconsistencies +between markdown engines. Please excuse the frustration noticeable in my +writing. + +## Examples of markdown's "stupid" list parsing + +``` +$ markdown.pl + + * item1 + + * item2 + + text +^D +

+``` + + +``` +$ marked + * item1 + + * item2 + + text +^D + +``` + +Which looks correct to you? + +- - - + +``` +$ markdown.pl +* hello + > world +^D +

+ +``` + +``` +$ marked +* hello + > world +^D + +``` + +Again, which looks correct to you? + +- - - + +EXAMPLE: + +``` +$ markdown.pl +* hello + * world + * hi + code +^D + +``` + +The code isn't a code block even though it's after the bullet margin. I know, +lets give it two more spaces, effectively making it 8 spaces past the bullet. + +``` +$ markdown.pl +* hello + * world + * hi + code +^D + +``` + +And, it's still not a code block. Did you also notice that the 3rd item isn't +even its own list? Markdown screws that up too because of its indentation +unaware parsing. + +- - - + +Let's look at some more examples of markdown's list parsing: + +``` +$ markdown.pl + + * item1 + + * item2 + + text +^D +

+``` + +Misnested tags. + + +``` +$ marked + * item1 + + * item2 + + text +^D + +``` + +Which looks correct to you? + +- - - + +``` +$ markdown.pl +* hello + > world +^D +

+ +``` + +More misnested tags. + + +``` +$ marked +* hello + > world +^D + +``` + +Again, which looks correct to you? + +- - - + +# Why quality matters - Part 2 + +``` bash +$ markdown.pl +* hello + > world +^D +

+ +``` + +``` bash +$ sundown # upskirt +* hello + > world +^D + +``` + +``` bash +$ marked +* hello + > world +^D + +``` + +Which looks correct to you? + +- - - + +See: https://github.com/evilstreak/markdown-js/issues/23 + +``` bash +$ markdown.pl # upskirt/markdown.js/discount +* hello + var a = 1; +* world +^D + +``` + +``` bash +$ marked +* hello + var a = 1; +* world +^D + +``` + +Which looks more reasonable? Why shouldn't code blocks be able to appear in +list items in a sane way? + +- - - + +``` bash +$ markdown.js +
hello
+ +hello +^D +

<div>hello</div>

+ +

<span>hello</span>

+``` + +``` bash +$ marked +
hello
+ +hello +^D +
hello
+ + +

hello +

+``` + +- - - + +See: https://github.com/evilstreak/markdown-js/issues/27 + +``` bash +$ markdown.js +[![an image](/image)](/link) +^D +

![an image

+``` + +``` bash +$ marked +[![an image](/image)](/link) +^D +

an image +

+``` + +- - - + +See: https://github.com/evilstreak/markdown-js/issues/24 + +``` bash +$ markdown.js +> a + +> b + +> c +^D +

a

bundefined> c

+``` + +``` bash +$ marked +> a + +> b + +> c +^D +

a + +

+

b + +

+

c +

+``` + +- - - + +``` bash +$ markdown.pl +* hello + * world + how + + are + you + + * today +* hi +^D + +``` + +``` bash +$ marked +* hello + * world + how + + are + you + + * today +* hi +^D + +``` diff --git a/app/bower_components/marked/doc/todo.md b/app/bower_components/marked/doc/todo.md new file mode 100644 index 000000000..2e60b162a --- /dev/null +++ b/app/bower_components/marked/doc/todo.md @@ -0,0 +1,2 @@ +# Todo + diff --git a/app/bower_components/marked/index.js b/app/bower_components/marked/index.js new file mode 100644 index 000000000..a12f90569 --- /dev/null +++ b/app/bower_components/marked/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/marked'); diff --git a/app/bower_components/marked/lib/marked.js b/app/bower_components/marked/lib/marked.js new file mode 100644 index 000000000..e2f08c998 --- /dev/null +++ b/app/bower_components/marked/lib/marked.js @@ -0,0 +1,1266 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +;(function() { + +/** + * Block-Level Grammar + */ + +var block = { + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, + fences: noop, + hr: /^( *[-*_]){3,} *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + nptable: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, + def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + table: noop, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, + text: /^[^\n]+/ +}; + +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = replace(block.item, 'gm') + (/bull/g, block.bullet) + (); + +block.list = replace(block.list) + (/bull/g, block.bullet) + ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('def', '\\n+(?=' + block.def.source + ')') + (); + +block.blockquote = replace(block.blockquote) + ('def', block.def) + (); + +block._tag = '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + +block.html = replace(block.html) + ('comment', //) + ('closed', /<(tag)[\s\S]+?<\/\1>/) + ('closing', /])*?>/) + (/tag/g, block._tag) + (); + +block.paragraph = replace(block.paragraph) + ('hr', block.hr) + ('heading', block.heading) + ('lheading', block.lheading) + ('blockquote', block.blockquote) + ('tag', '<' + block._tag) + ('def', block.def) + (); + +/** + * Normal Block Grammar + */ + +block.normal = merge({}, block); + +/** + * GFM Block Grammar + */ + +block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, + paragraph: /^/ +}); + +block.gfm.paragraph = replace(block.paragraph) + ('(?!', '(?!' + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') + (); + +/** + * GFM + Tables Block Grammar + */ + +block.tables = merge({}, block.gfm, { + nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, + table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ +}); + +/** + * Block Lexer + */ + +function Lexer(options) { + this.tokens = []; + this.tokens.links = {}; + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); +}; + +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top, bq) { + var src = src.replace(/^ +$/gm, '') + , next + , loose + , cap + , bull + , b + , item + , space + , i + , l; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); + this.tokens.push({ + type: 'code', + text: !this.options.pedantic + ? cap.replace(/\n+$/, '') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2], + text: cap[3] + }); + continue; + } + + // heading + if (cap = this.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (top && (cap = this.rules.nptable.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i].split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // lheading + if (cap = this.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[2] === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top, true); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + + this.tokens.push({ + type: 'list_start', + ordered: bull.length > 1 + }); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (this.options.smartLists && i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + this.tokens.push({ + type: loose + ? 'loose_item_start' + : 'list_item_start' + }); + + // Recurse. + this.token(item, false, bq); + + this.tokens.push({ + type: 'list_item_end' + }); + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: this.options.sanitize + ? 'paragraph' + : 'html', + pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', + text: cap[0] + }); + continue; + } + + // def + if ((!bq && top) && (cap = this.rules.def.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.links[cap[1].toLowerCase()] = { + href: cap[2], + title: cap[3] + }; + continue; + } + + // table (gfm) + if (top && (cap = this.rules.table.exec(src))) { + src = src.substring(cap[0].length); + + item = { + type: 'table', + header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + }; + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = item.cells[i] + .replace(/^ *\| *| *\| *$/g, '') + .split(/ *\| */); + } + + this.tokens.push(item); + + continue; + } + + // top-level paragraph + if (top && (cap = this.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** + * Inline-Level Grammar + */ + +var inline = { + escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, + autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, + url: noop, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + link: /^!?\[(inside)\]\(href\)/, + reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, + nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, + strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, + em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, + br: /^ {2,}\n(?!\s*$)/, + del: noop, + text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; + +inline.link = replace(inline.link) + ('inside', inline._inside) + ('href', inline._href) + (); + +inline.reflink = replace(inline.reflink) + ('inside', inline._inside) + (); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: replace(inline.escape)('])', '~|])')(), + url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, + del: /^~~(?=\S)([\s\S]*?\S)~~/, + text: replace(inline.text) + (']|', '~]|') + ('|', '|https?://|') + () +}); + +/** + * GFM + Line Breaks Inline Grammar + */ + +inline.breaks = merge({}, inline.gfm, { + br: replace(inline.br)('{2,}', '*')(), + text: replace(inline.gfm.text)('{2,}', '*')() +}); + +/** + * Inline Lexer & Compiler + */ + +function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + this.renderer = this.options.renderer || new Renderer; + this.renderer.options = this.options; + + if (!this.links) { + throw new + Error('Tokens array requires a `links` property.'); + } + + if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } else if (this.options.pedantic) { + this.rules = inline.pedantic; + } +} + +/** + * Expose Inline Rules + */ + +InlineLexer.rules = inline; + +/** + * Static Lexing/Compiling Method + */ + +InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); +}; + +/** + * Lexing/Compiling + */ + +InlineLexer.prototype.output = function(src) { + var out = '' + , link + , text + , href + , cap; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += cap[1]; + continue; + } + + // autolink + if (cap = this.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = cap[1].charAt(6) === ':' + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]); + href = this.mangle('mailto:') + text; + } else { + text = escape(cap[1]); + href = text; + } + out += this.renderer.link(href, null, text); + continue; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + src = src.substring(cap[0].length); + text = escape(cap[1]); + href = text; + out += this.renderer.link(href, null, text); + continue; + } + + // tag + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { + this.inLink = false; + } + src = src.substring(cap[0].length); + out += this.options.sanitize + ? escape(cap[0]) + : cap[0]; + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + src = src.substring(cap[0].length); + this.inLink = true; + out += this.outputLink(cap, { + href: cap[2], + title: cap[3] + }); + this.inLink = false; + continue; + } + + // reflink, nolink + if ((cap = this.rules.reflink.exec(src)) + || (cap = this.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0].charAt(0); + src = cap[0].substring(1) + src; + continue; + } + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2], true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + out += escape(this.smartypants(cap[0])); + continue; + } + + if (src) { + throw new + Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + var href = escape(link.href) + , title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/--/g, '\u2014') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + var out = '' + , l = text.length + , i = 0 + , ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Renderer + */ + +function Renderer(options) { + this.options = options || {}; +} + +Renderer.prototype.code = function(code, lang, escaped) { + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; + } + } + + if (!lang) { + return '
'
+      + (escaped ? code : escape(code, true))
+      + '\n
'; + } + + return '
'
+    + (escaped ? code : escape(code, true))
+    + '\n
\n'; +}; + +Renderer.prototype.blockquote = function(quote) { + return '
\n' + quote + '
\n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw) { + return '' + + text + + '\n'; +}; + +Renderer.prototype.hr = function() { + return this.options.xhtml ? '
\n' : '
\n'; +}; + +Renderer.prototype.list = function(body, ordered) { + var type = ordered ? 'ol' : 'ul'; + return '<' + type + '>\n' + body + '\n'; +}; + +Renderer.prototype.listitem = function(text) { + return '
  • ' + text + '
  • \n'; +}; + +Renderer.prototype.paragraph = function(text) { + return '

    ' + text + '

    \n'; +}; + +Renderer.prototype.table = function(header, body) { + return '\n' + + '\n' + + header + + '\n' + + '\n' + + body + + '\n' + + '
    \n'; +}; + +Renderer.prototype.tablerow = function(content) { + return '\n' + content + '\n'; +}; + +Renderer.prototype.tablecell = function(content, flags) { + var type = flags.header ? 'th' : 'td'; + var tag = flags.align + ? '<' + type + ' style="text-align:' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +Renderer.prototype.strong = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.em = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.codespan = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.br = function() { + return this.options.xhtml ? '
    ' : '
    '; +}; + +Renderer.prototype.del = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.link = function(href, title, text) { + if (this.options.sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return ''; + } + if (prot.indexOf('javascript:') === 0) { + return ''; + } + } + var out = '
    '; + return out; +}; + +Renderer.prototype.image = function(href, title, text) { + var out = '' + text + '' : '>'; + return out; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer; + this.renderer.options = this.options; +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options, renderer) { + var parser = new Parser(options, renderer); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + this.inline = new InlineLexer(src.links, this.options, this.renderer); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this.tok(); + } + + return out; +}; + +/** + * Next Token + */ + +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** + * Preview Next Token + */ + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; +}; + +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; + } + case 'hr': { + return this.renderer.hr(); + } + case 'heading': { + return this.renderer.heading( + this.inline.output(this.token.text), + this.token.depth, + this.token.text); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '' + , body = '' + , i + , row + , cell + , flags + , j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + flags = { header: true, align: this.token.align[i] }; + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); + } + case 'blockquote_start': { + var body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return this.renderer.blockquote(body); + } + case 'list_start': { + var body = '' + , ordered = this.token.ordered; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return this.renderer.list(body, ordered); + } + case 'list_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + + return this.renderer.listitem(body); + } + case 'loose_item_start': { + var body = ''; + + while (this.next().type !== 'list_item_end') { + body += this.tok(); + } + + return this.renderer.listitem(body); + } + case 'html': { + var html = !this.token.pre && !this.options.pedantic + ? this.inline.output(this.token.text) + : this.token.text; + return this.renderer.html(html); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + } +}; + +/** + * Helpers + */ + +function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +function unescape(html) { + return html.replace(/&([#\w]+);/g, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); +} + +function replace(regex, opt) { + regex = regex.source; + opt = opt || ''; + return function self(name, val) { + if (!name) return new RegExp(regex, opt); + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return self; + }; +} + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var i = 1 + , target + , key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; +} + + +/** + * Marked + */ + +function marked(src, opt, callback) { + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight + , tokens + , pending + , i = 0; + + try { + tokens = Lexer.lex(src, opt) + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function() { + var out, err; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) opt = merge({}, marked.defaults, opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/chjj/marked.'; + if ((opt || marked.defaults).silent) { + return '

    An error occured:

    '
    +        + escape(e.message + '', true)
    +        + '
    '; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; + +marked.defaults = { + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + smartLists: false, + silent: false, + highlight: null, + langPrefix: 'lang-', + smartypants: false, + headerPrefix: '', + renderer: new Renderer, + xhtml: false +}; + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.parse = marked; + +if (typeof exports === 'object') { + module.exports = marked; +} else if (typeof define === 'function' && define.amd) { + define(function() { return marked; }); +} else { + this.marked = marked; +} + +}).call(function() { + return this || (typeof window !== 'undefined' ? window : global); +}()); diff --git a/app/bower_components/marked/man/marked.1 b/app/bower_components/marked/man/marked.1 new file mode 100644 index 000000000..f89f1a7b9 --- /dev/null +++ b/app/bower_components/marked/man/marked.1 @@ -0,0 +1,88 @@ +.ds q \N'34' +.TH marked 1 "2014-01-31" "v0.3.1" "marked.js" + +.SH NAME +marked \- a javascript markdown parser + +.SH SYNOPSIS +.B marked +[\-o \fI\fP] [\-i \fI\fP] [\-\-help] +[\-\-tokens] [\-\-pedantic] [\-\-gfm] +[\-\-breaks] [\-\-tables] [\-\-sanitize] +[\-\-smart\-lists] [\-\-lang\-prefix \fI\fP] +[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP] + +.SH DESCRIPTION +.B marked +is a full-featured javascript markdown parser, built for speed. It also includes +multiple GFM features. + +.SH EXAMPLES +.TP +cat in.md | marked > out.html +.TP +echo "hello *world*" | marked +.TP +marked \-o out.html in.md \-\-gfm +.TP +marked \-\-output="hello world.html" \-i in.md \-\-no-breaks + +.SH OPTIONS +.TP +.BI \-o,\ \-\-output\ [\fIoutput\fP] +Specify file output. If none is specified, write to stdout. +.TP +.BI \-i,\ \-\-input\ [\fIinput\fP] +Specify file input, otherwise use last argument as input file. If no input file +is specified, read from stdin. +.TP +.BI \-t,\ \-\-tokens +Output a token stream instead of html. +.TP +.BI \-\-pedantic +Conform to obscure parts of markdown.pl as much as possible. Don't fix original +markdown bugs. +.TP +.BI \-\-gfm +Enable github flavored markdown. +.TP +.BI \-\-breaks +Enable GFM line breaks. Only works with the gfm option. +.TP +.BI \-\-tables +Enable GFM tables. Only works with the gfm option. +.TP +.BI \-\-sanitize +Sanitize output. Ignore any HTML input. +.TP +.BI \-\-smart\-lists +Use smarter list behavior than the original markdown. +.TP +.BI \-\-lang\-prefix\ [\fIprefix\fP] +Set the prefix for code block classes. +.TP +.BI \-\-no\-sanitize,\ \-no-etc... +The inverse of any of the marked options above. +.TP +.BI \-\-silent +Silence error output. +.TP +.BI \-h,\ \-\-help +Display help information. + +.SH CONFIGURATION +For configuring and running programmatically. + +.B Example + + require('marked')('*foo*', { gfm: true }); + +.SH BUGS +Please report any bugs to https://github.com/chjj/marked. + +.SH LICENSE +Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). + +.SH "SEE ALSO" +.BR markdown(1), +.BR node.js(1) diff --git a/app/bower_components/marked/package.json b/app/bower_components/marked/package.json new file mode 100644 index 000000000..4eb60d547 --- /dev/null +++ b/app/bower_components/marked/package.json @@ -0,0 +1,22 @@ +{ + "name": "marked", + "description": "A markdown parser built for speed", + "author": "Christopher Jeffrey", + "version": "0.3.2", + "main": "./lib/marked.js", + "bin": "./bin/marked", + "man": "./man/marked.1", + "preferGlobal": true, + "repository": "git://github.com/chjj/marked.git", + "homepage": "https://github.com/chjj/marked", + "bugs": { "url": "http://github.com/chjj/marked/issues" }, + "license": "MIT", + "keywords": ["markdown", "markup", "html"], + "tags": ["markdown", "markup", "html"], + "devDependencies": { + "markdown": "*", + "showdown": "*", + "robotskirt": "*" + }, + "scripts": { "test": "node test", "bench": "node test --bench" } +} diff --git a/app/bower_components/marked/test/README b/app/bower_components/marked/test/README new file mode 100644 index 000000000..51f6560b9 --- /dev/null +++ b/app/bower_components/marked/test/README @@ -0,0 +1,10 @@ +In this directory: + +# +# MarkdownTester -- Run tests for Markdown implementations +# +# Copyright (c) 2004-2005 John Gruber +# +# + +Partially modified for testing purposes. diff --git a/app/bower_components/marked/test/browser/index.html b/app/bower_components/marked/test/browser/index.html new file mode 100644 index 000000000..fbde12931 --- /dev/null +++ b/app/bower_components/marked/test/browser/index.html @@ -0,0 +1,5 @@ + +marked tests +

    testing...

    + + diff --git a/app/bower_components/marked/test/browser/index.js b/app/bower_components/marked/test/browser/index.js new file mode 100644 index 000000000..d5d7ee698 --- /dev/null +++ b/app/bower_components/marked/test/browser/index.js @@ -0,0 +1,41 @@ +var fs = require('fs'); + +var test = require('../') + , runTests = test.runTests + , load = test.load; + +var express = require('express') + , app = express(); + +app.use(function(req, res, next) { + var setHeader = res.setHeader; + res.setHeader = function(name) { + switch (name) { + case 'Cache-Control': + case 'Last-Modified': + case 'ETag': + return; + } + return setHeader.apply(res, arguments); + }; + next(); +}); + +var dir = __dirname + '/../tests' + , files = {}; + +app.get('/test.js', function(req, res, next) { + var test = fs.readFileSync(__dirname + '/test.js', 'utf8') + , files = load(); + + test = test.replace('__TESTS__', JSON.stringify(files)); + test = test.replace('__MAIN__', runTests + ''); + + res.contentType('.js'); + res.send(test); +}); + +app.use(express.static(__dirname + '/../../lib')); +app.use(express.static(__dirname)); + +app.listen(8080); diff --git a/app/bower_components/marked/test/browser/test.js b/app/bower_components/marked/test/browser/test.js new file mode 100644 index 000000000..cef9e376f --- /dev/null +++ b/app/bower_components/marked/test/browser/test.js @@ -0,0 +1,62 @@ +;(function() { + +var console = {} + , files = __TESTS__; + +console.log = function(text) { + var args = Array.prototype.slice.call(arguments, 1) + , i = 0; + + text = text.replace(/%\w/g, function() { + return args[i++] || ''; + }); + + if (window.console) window.console.log(text); + document.body.innerHTML += '
    ' + escape(text) + '
    '; +}; + +if (!Object.keys) { + Object.keys = function(obj) { + var out = [] + , key; + + for (key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + out.push(key); + } + } + + return out; + }; +} + +if (!Array.prototype.forEach) { + Array.prototype.forEach = function(callback, context) { + for (var i = 0; i < this.length; i++) { + callback.call(context || null, this[i], i, obj); + } + }; +} + +if (!String.prototype.trim) { + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + }; +} + +function load() { + return files; +} + +function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + +(__MAIN__)(); + +}).call(this); diff --git a/app/bower_components/marked/test/index.js b/app/bower_components/marked/test/index.js new file mode 100644 index 000000000..35b52e2ae --- /dev/null +++ b/app/bower_components/marked/test/index.js @@ -0,0 +1,543 @@ +#!/usr/bin/env node + +/** + * marked tests + * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ + +/** + * Modules + */ + +var fs = require('fs') + , path = require('path') + , marked = require('../'); + +/** + * Load Tests + */ + +function load() { + var dir = __dirname + '/tests' + , files = {} + , list + , file + , i + , l; + + list = fs + .readdirSync(dir) + .filter(function(file) { + return path.extname(file) !== '.html'; + }) + .sort(function(a, b) { + a = path.basename(a).toLowerCase().charCodeAt(0); + b = path.basename(b).toLowerCase().charCodeAt(0); + return a > b ? 1 : (a < b ? -1 : 0); + }); + + i = 0; + l = list.length; + + for (; i < l; i++) { + file = path.join(dir, list[i]); + files[path.basename(file)] = { + text: fs.readFileSync(file, 'utf8'), + html: fs.readFileSync(file.replace(/[^.]+$/, 'html'), 'utf8') + }; + } + + return files; +} + +/** + * Test Runner + */ + +function runTests(engine, options) { + if (typeof engine !== 'function') { + options = engine; + engine = null; + } + + var engine = engine || marked + , options = options || {} + , files = options.files || load() + , complete = 0 + , failed = 0 + , failures = [] + , keys = Object.keys(files) + , i = 0 + , len = keys.length + , filename + , file + , flags + , text + , html + , j + , l; + + if (options.marked) { + marked.setOptions(options.marked); + } + +main: + for (; i < len; i++) { + filename = keys[i]; + file = files[filename]; + + if (marked._original) { + marked.defaults = marked._original; + delete marked._original; + } + + flags = filename.split('.').slice(1, -1); + if (flags.length) { + marked._original = marked.defaults; + marked.defaults = {}; + Object.keys(marked._original).forEach(function(key) { + marked.defaults[key] = marked._original[key]; + }); + flags.forEach(function(key) { + var val = true; + if (key.indexOf('no') === 0) { + key = key.substring(2); + val = false; + } + if (marked.defaults.hasOwnProperty(key)) { + marked.defaults[key] = val; + } + }); + } + + try { + text = engine(file.text).replace(/\s/g, ''); + html = file.html.replace(/\s/g, ''); + } catch(e) { + console.log('%s failed.', filename); + throw e; + } + + j = 0; + l = html.length; + + for (; j < l; j++) { + if (text[j] !== html[j]) { + failed++; + failures.push(filename); + + text = text.substring( + Math.max(j - 30, 0), + Math.min(j + 30, text.length)); + + html = html.substring( + Math.max(j - 30, 0), + Math.min(j + 30, html.length)); + + console.log( + '\n#%d. %s failed at offset %d. Near: "%s".\n', + i + 1, filename, j, text); + + console.log('\nGot:\n%s\n', text.trim() || text); + console.log('\nExpected:\n%s\n', html.trim() || html); + + if (options.stop) { + break main; + } + + continue main; + } + } + + complete++; + console.log('#%d. %s completed.', i + 1, filename); + } + + console.log('%d/%d tests completed successfully.', complete, len); + if (failed) console.log('%d/%d tests failed.', failed, len); + + // Tests currently failing. + if (~failures.indexOf('def_blocks.text') + && ~failures.indexOf('double_link.text') + && ~failures.indexOf('gfm_code_hr_list.text')) { + failed -= 3; + } + + return !failed; +} + +/** + * Benchmark a function + */ + +function bench(name, func) { + var files = bench.files || load(); + + if (!bench.files) { + bench.files = files; + + // Change certain tests to allow + // comparison to older benchmark times. + fs.readdirSync(__dirname + '/new').forEach(function(name) { + if (path.extname(name) === '.html') return; + if (name === 'main.text') return; + delete files[name]; + }); + + files['backslash_escapes.text'] = { + text: 'hello world \\[how](are you) today' + }; + + files['main.text'].text = files['main.text'].text.replace('* * *\n\n', ''); + } + + var start = Date.now() + , times = 1000 + , keys = Object.keys(files) + , i + , l = keys.length + , filename + , file; + + while (times--) { + for (i = 0; i < l; i++) { + filename = keys[i]; + file = files[filename]; + func(file.text); + } + } + + console.log('%s completed in %dms.', name, Date.now() - start); +} + +/** + * Benchmark all engines + */ + +function runBench(options) { + var options = options || {}; + + // Non-GFM, Non-pedantic + marked.setOptions({ + gfm: false, + tables: false, + breaks: false, + pedantic: false, + sanitize: false, + smartLists: false + }); + if (options.marked) { + marked.setOptions(options.marked); + } + bench('marked', marked); + + // GFM + marked.setOptions({ + gfm: true, + tables: false, + breaks: false, + pedantic: false, + sanitize: false, + smartLists: false + }); + if (options.marked) { + marked.setOptions(options.marked); + } + bench('marked (gfm)', marked); + + // Pedantic + marked.setOptions({ + gfm: false, + tables: false, + breaks: false, + pedantic: true, + sanitize: false, + smartLists: false + }); + if (options.marked) { + marked.setOptions(options.marked); + } + bench('marked (pedantic)', marked); + + // robotskirt + try { + bench('robotskirt', (function() { + var rs = require('robotskirt'); + return function(text) { + var parser = rs.Markdown.std(); + return parser.render(text); + }; + })()); + } catch (e) { + console.log('Could not bench robotskirt.'); + } + + // showdown + try { + bench('showdown (reuse converter)', (function() { + var Showdown = require('showdown'); + var convert = new Showdown.converter(); + return function(text) { + return convert.makeHtml(text); + }; + })()); + bench('showdown (new converter)', (function() { + var Showdown = require('showdown'); + return function(text) { + var convert = new Showdown.converter(); + return convert.makeHtml(text); + }; + })()); + } catch (e) { + console.log('Could not bench showdown.'); + } + + // markdown.js + try { + bench('markdown.js', require('markdown').parse); + } catch (e) { + console.log('Could not bench markdown.js.'); + } +} + +/** + * A simple one-time benchmark + */ + +function time(options) { + var options = options || {}; + if (options.marked) { + marked.setOptions(options.marked); + } + bench('marked', marked); +} + +/** + * Markdown Test Suite Fixer + * This function is responsible for "fixing" + * the markdown test suite. There are + * certain aspects of the suite that + * are strange or might make tests + * fail for reasons unrelated to + * conformance. + */ + +function fix(options) { + ['tests', 'original', 'new'].forEach(function(dir) { + try { + fs.mkdirSync(path.resolve(__dirname, dir), 0755); + } catch (e) { + ; + } + }); + + // rm -rf tests + fs.readdirSync(path.resolve(__dirname, 'tests')).forEach(function(file) { + fs.unlinkSync(path.resolve(__dirname, 'tests', file)); + }); + + // cp -r original tests + fs.readdirSync(path.resolve(__dirname, 'original')).forEach(function(file) { + var nfile = file; + if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.') === 0) { + nfile = file.replace(/\.(text|html)$/, '.nogfm.$1'); + } + fs.writeFileSync(path.resolve(__dirname, 'tests', nfile), + fs.readFileSync(path.resolve(__dirname, 'original', file))); + }); + + // node fix.js + var dir = __dirname + '/tests'; + + fs.readdirSync(dir).filter(function(file) { + return path.extname(file) === '.html'; + }).forEach(function(file) { + var file = path.join(dir, file) + , html = fs.readFileSync(file, 'utf8'); + + // fix unencoded quotes + html = html + .replace(/='([^\n']*)'(?=[^<>\n]*>)/g, '=&__APOS__;$1&__APOS__;') + .replace(/="([^\n"]*)"(?=[^<>\n]*>)/g, '=&__QUOT__;$1&__QUOT__;') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(/&__QUOT__;/g, '"') + .replace(/&__APOS__;/g, '\''); + + // add heading id's + html = html.replace(/<(h[1-6])>([^<]+)<\/\1>/g, function(s, h, text) { + var id = text + .replace(/'/g, '\'') + .replace(/"/g, '"') + .replace(/>/g, '>') + .replace(/</g, '<') + .replace(/&/g, '&'); + + id = id.toLowerCase().replace(/[^\w]+/g, '-'); + + return '<' + h + ' id="' + id + '">' + text + ''; + }); + + fs.writeFileSync(file, html); + }); + + // turn
    into
    + fs.readdirSync(dir).forEach(function(file) { + var file = path.join(dir, file) + , text = fs.readFileSync(file, 'utf8'); + + text = text.replace(/(<|<)hr\s*\/(>|>)/g, '$1hr$2'); + + fs.writeFileSync(file, text); + }); + + // markdown does some strange things. + // it does not encode naked `>`, marked does. + (function() { + var file = dir + '/amps_and_angles_encoding.html'; + var html = fs.readFileSync(file, 'utf8') + .replace('6 > 5.', '6 > 5.'); + + fs.writeFileSync(file, html); + })(); + + // cp new/* tests/ + fs.readdirSync(path.resolve(__dirname, 'new')).forEach(function(file) { + fs.writeFileSync(path.resolve(__dirname, 'tests', file), + fs.readFileSync(path.resolve(__dirname, 'new', file))); + }); +} + +/** + * Argument Parsing + */ + +function parseArg(argv) { + var argv = process.argv.slice(2) + , options = {} + , orphans = [] + , arg; + + function getarg() { + var arg = argv.shift(); + + if (arg.indexOf('--') === 0) { + // e.g. --opt + arg = arg.split('='); + if (arg.length > 1) { + // e.g. --opt=val + argv.unshift(arg.slice(1).join('=')); + } + arg = arg[0]; + } else if (arg[0] === '-') { + if (arg.length > 2) { + // e.g. -abc + argv = arg.substring(1).split('').map(function(ch) { + return '-' + ch; + }).concat(argv); + arg = argv.shift(); + } else { + // e.g. -a + } + } else { + // e.g. foo + } + + return arg; + } + + while (argv.length) { + arg = getarg(); + switch (arg) { + case '-f': + case '--fix': + case 'fix': + options.fix = true; + break; + case '-b': + case '--bench': + options.bench = true; + break; + case '-s': + case '--stop': + options.stop = true; + break; + case '-t': + case '--time': + options.time = true; + break; + default: + if (arg.indexOf('--') === 0) { + opt = camelize(arg.replace(/^--(no-)?/, '')); + if (!marked.defaults.hasOwnProperty(opt)) { + continue; + } + options.marked = options.marked || {}; + if (arg.indexOf('--no-') === 0) { + options.marked[opt] = typeof marked.defaults[opt] !== 'boolean' + ? null + : false; + } else { + options.marked[opt] = typeof marked.defaults[opt] !== 'boolean' + ? argv.shift() + : true; + } + } else { + orphans.push(arg); + } + break; + } + } + + return options; +} + +/** + * Helpers + */ + +function camelize(text) { + return text.replace(/(\w)-(\w)/g, function(_, a, b) { + return a + b.toUpperCase(); + }); +} + +/** + * Main + */ + +function main(argv) { + var opt = parseArg(); + + if (opt.fix) { + return fix(opt); + } + + if (opt.bench) { + return runBench(opt); + } + + if (opt.time) { + return time(opt); + } + + return runTests(opt); +} + +/** + * Execute + */ + +if (!module.parent) { + process.title = 'marked'; + process.exit(main(process.argv.slice()) ? 0 : 1); +} else { + exports = main; + exports.main = main; + exports.runTests = runTests; + exports.runBench = runBench; + exports.load = load; + exports.bench = bench; + module.exports = exports; +} diff --git a/app/bower_components/marked/test/new/autolink_lines.html b/app/bower_components/marked/test/new/autolink_lines.html new file mode 100644 index 000000000..aa2bed4d3 --- /dev/null +++ b/app/bower_components/marked/test/new/autolink_lines.html @@ -0,0 +1,3 @@ +

    hello world +http://example.com +

    diff --git a/app/bower_components/marked/test/new/autolink_lines.text b/app/bower_components/marked/test/new/autolink_lines.text new file mode 100644 index 000000000..c9b61a2ca --- /dev/null +++ b/app/bower_components/marked/test/new/autolink_lines.text @@ -0,0 +1,2 @@ +hello world + diff --git a/app/bower_components/marked/test/new/blockquote_list_item.html b/app/bower_components/marked/test/new/blockquote_list_item.html new file mode 100644 index 000000000..83cf0bddf --- /dev/null +++ b/app/bower_components/marked/test/new/blockquote_list_item.html @@ -0,0 +1,3 @@ +

    This fails in markdown.pl and upskirt:

    + +
    • hello

      world

    diff --git a/app/bower_components/marked/test/new/blockquote_list_item.text b/app/bower_components/marked/test/new/blockquote_list_item.text new file mode 100644 index 000000000..19e938294 --- /dev/null +++ b/app/bower_components/marked/test/new/blockquote_list_item.text @@ -0,0 +1,4 @@ +This fails in markdown.pl and upskirt: + +* hello + > world diff --git a/app/bower_components/marked/test/new/case_insensitive_refs.html b/app/bower_components/marked/test/new/case_insensitive_refs.html new file mode 100644 index 000000000..c54388ea5 --- /dev/null +++ b/app/bower_components/marked/test/new/case_insensitive_refs.html @@ -0,0 +1 @@ +

    hi

    diff --git a/app/bower_components/marked/test/new/case_insensitive_refs.text b/app/bower_components/marked/test/new/case_insensitive_refs.text new file mode 100644 index 000000000..598915a8a --- /dev/null +++ b/app/bower_components/marked/test/new/case_insensitive_refs.text @@ -0,0 +1,3 @@ +[hi] + +[HI]: /url diff --git a/app/bower_components/marked/test/new/def_blocks.html b/app/bower_components/marked/test/new/def_blocks.html new file mode 100644 index 000000000..14edc97a4 --- /dev/null +++ b/app/bower_components/marked/test/new/def_blocks.html @@ -0,0 +1,28 @@ +
    +

    hello +[1]: hello

    +
    + +
    + +
    +

    hello

    +
    + + +
      +
    • hello
    • +
    • [3]: hello
    • +
    + + +
      +
    • hello
    • +
    + + +
    +

    foo +bar +bar

    +
    diff --git a/app/bower_components/marked/test/new/def_blocks.text b/app/bower_components/marked/test/new/def_blocks.text new file mode 100644 index 000000000..4d1629298 --- /dev/null +++ b/app/bower_components/marked/test/new/def_blocks.text @@ -0,0 +1,21 @@ +> hello +> [1]: hello + +* * * + +> hello +[2]: hello + + +* hello +* [3]: hello + + +* hello +[4]: hello + + +> foo +> bar +[1]: foo +> bar diff --git a/app/bower_components/marked/test/new/double_link.html b/app/bower_components/marked/test/new/double_link.html new file mode 100644 index 000000000..ff68395a3 --- /dev/null +++ b/app/bower_components/marked/test/new/double_link.html @@ -0,0 +1,5 @@ +

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

    + +

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

    + +

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

    diff --git a/app/bower_components/marked/test/new/double_link.text b/app/bower_components/marked/test/new/double_link.text new file mode 100644 index 000000000..50216736c --- /dev/null +++ b/app/bower_components/marked/test/new/double_link.text @@ -0,0 +1,5 @@ +

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

    + +Already linked: [http://example.com/](http://example.com/). + +Already linked: **http://example.com/**. diff --git a/app/bower_components/marked/test/new/escaped_angles.html b/app/bower_components/marked/test/new/escaped_angles.html new file mode 100644 index 000000000..7cf47c49e --- /dev/null +++ b/app/bower_components/marked/test/new/escaped_angles.html @@ -0,0 +1 @@ +

    >

    diff --git a/app/bower_components/marked/test/new/escaped_angles.text b/app/bower_components/marked/test/new/escaped_angles.text new file mode 100644 index 000000000..db7422f13 --- /dev/null +++ b/app/bower_components/marked/test/new/escaped_angles.text @@ -0,0 +1 @@ +\> diff --git a/app/bower_components/marked/test/new/gfm_break.breaks.html b/app/bower_components/marked/test/new/gfm_break.breaks.html new file mode 100644 index 000000000..398ba018c --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_break.breaks.html @@ -0,0 +1 @@ +

    Look at the
    pretty line
    breaks.

    diff --git a/app/bower_components/marked/test/new/gfm_break.breaks.text b/app/bower_components/marked/test/new/gfm_break.breaks.text new file mode 100644 index 000000000..71097d23b --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_break.breaks.text @@ -0,0 +1,3 @@ +Look at the +pretty line +breaks. diff --git a/app/bower_components/marked/test/new/gfm_code.html b/app/bower_components/marked/test/new/gfm_code.html new file mode 100644 index 000000000..fe3522e23 --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_code.html @@ -0,0 +1,5 @@ +
    var a = 'hello';
    +console.log(a + ' world');
    +
    echo "hello, ${WORLD}"
    +
    Q: What do you call a tall person who sells stolen goods?
    +
    A longfence!
    diff --git a/app/bower_components/marked/test/new/gfm_code.text b/app/bower_components/marked/test/new/gfm_code.text new file mode 100644 index 000000000..c594387c4 --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_code.text @@ -0,0 +1,16 @@ +``` js +var a = 'hello'; +console.log(a + ' world'); +``` + +~~~bash +echo "hello, ${WORLD}" +~~~ + +```````longfence +Q: What do you call a tall person who sells stolen goods? +``````` + +~~~~~~~~~~ ManyTildes +A longfence! +~~~~~~~~~~ diff --git a/app/bower_components/marked/test/new/gfm_code_hr_list.html b/app/bower_components/marked/test/new/gfm_code_hr_list.html new file mode 100644 index 000000000..9fbd0fb9d --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_code_hr_list.html @@ -0,0 +1,52 @@ +

    foo

    +
      +
    1. bar:

      +
      +
        +
      • one
          +
        • two
            +
          • three
          • +
          • four
          • +
          • five
          • +
          +
        • +
        +
      • +
      +
      +
    2. +
    3. foo:

      +
       line 1
      + line 2
      +
    4. +
    5. foo:

      +
        +
      1. foo bar bar:

        +
         some code here
        +
        +
      2. +
      3. foo bar bar:

        +
         foo
        + ---
        + bar
        + ---
        + foo
        + bar
        +
      4. +
      5. foo bar bar:

        +
         ---
        + foo
        + foo
        + ---
        + bar
        +
      6. +
      7. foo bar bar:

        +
         foo
        + ---
        + bar
        +
      8. +
      9. foo

        +
      10. +
      +
    6. +
    diff --git a/app/bower_components/marked/test/new/gfm_code_hr_list.text b/app/bower_components/marked/test/new/gfm_code_hr_list.text new file mode 100644 index 000000000..0eba40598 --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_code_hr_list.text @@ -0,0 +1,53 @@ +## foo + +1. bar: + + > - one + - two + - three + - four + - five + +1. foo: + + ``` + line 1 + line 2 + ``` + +1. foo: + + 1. foo `bar` bar: + + ``` erb + some code here + ``` + + 2. foo `bar` bar: + + ``` erb + foo + --- + bar + --- + foo + bar + ``` + + 3. foo `bar` bar: + + ``` html + --- + foo + foo + --- + bar + ``` + + 4. foo `bar` bar: + + foo + --- + bar + + 5. foo diff --git a/app/bower_components/marked/test/new/gfm_del.html b/app/bower_components/marked/test/new/gfm_del.html new file mode 100644 index 000000000..95e9ec74b --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_del.html @@ -0,0 +1 @@ +

    hello hi world

    diff --git a/app/bower_components/marked/test/new/gfm_del.text b/app/bower_components/marked/test/new/gfm_del.text new file mode 100644 index 000000000..d29ca77d4 --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_del.text @@ -0,0 +1 @@ +hello ~~hi~~ world diff --git a/app/bower_components/marked/test/new/gfm_em.html b/app/bower_components/marked/test/new/gfm_em.html new file mode 100644 index 000000000..8fac3466a --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_em.html @@ -0,0 +1 @@ +

    These words should_not_be_emphasized.

    diff --git a/app/bower_components/marked/test/new/gfm_em.text b/app/bower_components/marked/test/new/gfm_em.text new file mode 100644 index 000000000..6319874b9 --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_em.text @@ -0,0 +1 @@ +These words should_not_be_emphasized. diff --git a/app/bower_components/marked/test/new/gfm_links.html b/app/bower_components/marked/test/new/gfm_links.html new file mode 100644 index 000000000..4f62ae1de --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_links.html @@ -0,0 +1,2 @@ +

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

    diff --git a/app/bower_components/marked/test/new/gfm_links.text b/app/bower_components/marked/test/new/gfm_links.text new file mode 100644 index 000000000..c1336661a --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_links.text @@ -0,0 +1 @@ +This should be a link: http://example.com/hello-world. diff --git a/app/bower_components/marked/test/new/gfm_tables.html b/app/bower_components/marked/test/new/gfm_tables.html new file mode 100644 index 000000000..70bec827e --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_tables.html @@ -0,0 +1,37 @@ + + + + + + + + +
    Heading 1Heading 2
    Cell 1Cell 2
    Cell 3Cell 4
    + + + + + + + + +
    Header 1Header 2Header 3Header 4
    Cell 1Cell 2Cell 3Cell 4
    Cell 5Cell 6Cell 7Cell 8
    +
    Test code
    + + + + + + + + +
    Header 1Header 2
    Cell 1Cell 2
    Cell 3Cell 4
    + + + + + + + + +
    Header 1Header 2Header 3Header 4
    Cell 1Cell 2Cell 3Cell 4
    Cell 5Cell 6Cell 7Cell 8
    diff --git a/app/bower_components/marked/test/new/gfm_tables.text b/app/bower_components/marked/test/new/gfm_tables.text new file mode 100644 index 000000000..5fd6321c1 --- /dev/null +++ b/app/bower_components/marked/test/new/gfm_tables.text @@ -0,0 +1,21 @@ +| Heading 1 | Heading 2 +| --------- | --------- +| Cell 1 | Cell 2 +| Cell 3 | Cell 4 + +| Header 1 | Header 2 | Header 3 | Header 4 | +| :------: | -------: | :------- | -------- | +| Cell 1 | Cell 2 | Cell 3 | Cell 4 | +| Cell 5 | Cell 6 | Cell 7 | Cell 8 | + + Test code + +Header 1 | Header 2 +-------- | -------- +Cell 1 | Cell 2 +Cell 3 | Cell 4 + +Header 1|Header 2|Header 3|Header 4 +:-------|:------:|-------:|-------- +Cell 1 |Cell 2 |Cell 3 |Cell 4 +*Cell 5*|Cell 6 |Cell 7 |Cell 8 diff --git a/app/bower_components/marked/test/new/hr_list_break.html b/app/bower_components/marked/test/new/hr_list_break.html new file mode 100644 index 000000000..bd3ad1f7c --- /dev/null +++ b/app/bower_components/marked/test/new/hr_list_break.html @@ -0,0 +1,10 @@ +
      +
    • hello +world
    • +
    • how +are
    • +
    + +
    + +

    you today?

    diff --git a/app/bower_components/marked/test/new/hr_list_break.text b/app/bower_components/marked/test/new/hr_list_break.text new file mode 100644 index 000000000..036fe4794 --- /dev/null +++ b/app/bower_components/marked/test/new/hr_list_break.text @@ -0,0 +1,6 @@ +* hello +world +* how +are +* * * +you today? diff --git a/app/bower_components/marked/test/new/lazy_blockquotes.html b/app/bower_components/marked/test/new/lazy_blockquotes.html new file mode 100644 index 000000000..a701d42af --- /dev/null +++ b/app/bower_components/marked/test/new/lazy_blockquotes.html @@ -0,0 +1,4 @@ +
    +

    hi there +bud

    +
    diff --git a/app/bower_components/marked/test/new/lazy_blockquotes.text b/app/bower_components/marked/test/new/lazy_blockquotes.text new file mode 100644 index 000000000..c0e0b1549 --- /dev/null +++ b/app/bower_components/marked/test/new/lazy_blockquotes.text @@ -0,0 +1,2 @@ +> hi there +bud diff --git a/app/bower_components/marked/test/new/list_item_text.html b/app/bower_components/marked/test/new/list_item_text.html new file mode 100644 index 000000000..142df366e --- /dev/null +++ b/app/bower_components/marked/test/new/list_item_text.html @@ -0,0 +1 @@ +
    • item1

      • item2

      text

    diff --git a/app/bower_components/marked/test/new/list_item_text.text b/app/bower_components/marked/test/new/list_item_text.text new file mode 100644 index 000000000..a8f81b140 --- /dev/null +++ b/app/bower_components/marked/test/new/list_item_text.text @@ -0,0 +1,5 @@ + * item1 + + * item2 + + text diff --git a/app/bower_components/marked/test/new/loose_lists.html b/app/bower_components/marked/test/new/loose_lists.html new file mode 100644 index 000000000..c1bd82a26 --- /dev/null +++ b/app/bower_components/marked/test/new/loose_lists.html @@ -0,0 +1,62 @@ +
      +
    • hello +world

      + +

      how +are

    • +
    • you
    • +
    + + + +

    better behavior:

    + +
    • hello

      • world +how

        are +you

      • today

    • hi
    + + + +
      +
    • hello

    • +
    • world

    • +
    • hi
    • +
    + + + +
      +
    • hello
    • +
    • world

    • +
    • hi

    • +
    + + + +
      +
    • hello
    • +
    • world

      + +

      how

    • +
    • hi
    • +
    + + + +
      +
    • hello
    • +
    • world
    • +
    • how

      + +

      are

    • +
    + + + +
      +
    • hello
    • +
    • world

    • +
    • how

      + +

      are

    • +
    diff --git a/app/bower_components/marked/test/new/loose_lists.text b/app/bower_components/marked/test/new/loose_lists.text new file mode 100644 index 000000000..cb360a15d --- /dev/null +++ b/app/bower_components/marked/test/new/loose_lists.text @@ -0,0 +1,59 @@ +* hello + world + + how + are +* you + + + +better behavior: + +* hello + * world + how + + are + you + + * today +* hi + + + +* hello + +* world +* hi + + + +* hello +* world + +* hi + + + +* hello +* world + + how +* hi + + + +* hello +* world +* how + + are + + + +* hello +* world + +* how + + are diff --git a/app/bower_components/marked/test/new/main.html b/app/bower_components/marked/test/new/main.html new file mode 100644 index 000000000..8f78c4d30 --- /dev/null +++ b/app/bower_components/marked/test/new/main.html @@ -0,0 +1,4 @@ +

    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.
        +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.
    +Lots of it...
    diff --git a/app/bower_components/marked/test/new/main.text b/app/bower_components/marked/test/new/main.text new file mode 100644 index 000000000..58e17a6a7 --- /dev/null +++ b/app/bower_components/marked/test/new/main.text @@ -0,0 +1,55 @@ +[test]: http://google.com/ "Google" + +# 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][test] 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. + 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](//hello). +And an image ![alt](src). + + Code goes here. + Lots of it... diff --git a/app/bower_components/marked/test/new/nested_code.html b/app/bower_components/marked/test/new/nested_code.html new file mode 100644 index 000000000..c37059201 --- /dev/null +++ b/app/bower_components/marked/test/new/nested_code.html @@ -0,0 +1 @@ +

    hi ther `` ok ```

    diff --git a/app/bower_components/marked/test/new/nested_code.text b/app/bower_components/marked/test/new/nested_code.text new file mode 100644 index 000000000..910e3d462 --- /dev/null +++ b/app/bower_components/marked/test/new/nested_code.text @@ -0,0 +1 @@ +````` hi ther `` ok ``` ````` diff --git a/app/bower_components/marked/test/new/nested_em.html b/app/bower_components/marked/test/new/nested_em.html new file mode 100644 index 000000000..3ab4ec89c --- /dev/null +++ b/app/bower_components/marked/test/new/nested_em.html @@ -0,0 +1,3 @@ +

    test test test

    + +

    test test test

    diff --git a/app/bower_components/marked/test/new/nested_em.text b/app/bower_components/marked/test/new/nested_em.text new file mode 100644 index 000000000..550d0eb99 --- /dev/null +++ b/app/bower_components/marked/test/new/nested_em.text @@ -0,0 +1,3 @@ +*test **test** test* + +_test __test__ test_ diff --git a/app/bower_components/marked/test/new/nested_square_link.html b/app/bower_components/marked/test/new/nested_square_link.html new file mode 100644 index 000000000..c8b794083 --- /dev/null +++ b/app/bower_components/marked/test/new/nested_square_link.html @@ -0,0 +1 @@ +

    the ] character

    diff --git a/app/bower_components/marked/test/new/nested_square_link.text b/app/bower_components/marked/test/new/nested_square_link.text new file mode 100644 index 000000000..82226ed5f --- /dev/null +++ b/app/bower_components/marked/test/new/nested_square_link.text @@ -0,0 +1 @@ +[the `]` character](/url) diff --git a/app/bower_components/marked/test/new/not_a_link.html b/app/bower_components/marked/test/new/not_a_link.html new file mode 100644 index 000000000..a01685d24 --- /dev/null +++ b/app/bower_components/marked/test/new/not_a_link.html @@ -0,0 +1 @@ +

    [test](not a link)

    diff --git a/app/bower_components/marked/test/new/not_a_link.text b/app/bower_components/marked/test/new/not_a_link.text new file mode 100644 index 000000000..26f60437d --- /dev/null +++ b/app/bower_components/marked/test/new/not_a_link.text @@ -0,0 +1 @@ +\[test](not a link) diff --git a/app/bower_components/marked/test/new/ref_paren.html b/app/bower_components/marked/test/new/ref_paren.html new file mode 100644 index 000000000..cff6977fb --- /dev/null +++ b/app/bower_components/marked/test/new/ref_paren.html @@ -0,0 +1 @@ +

    hi

    diff --git a/app/bower_components/marked/test/new/ref_paren.text b/app/bower_components/marked/test/new/ref_paren.text new file mode 100644 index 000000000..aa97c91ae --- /dev/null +++ b/app/bower_components/marked/test/new/ref_paren.text @@ -0,0 +1,3 @@ +[hi] + +[hi]: /url (there) diff --git a/app/bower_components/marked/test/new/same_bullet.html b/app/bower_components/marked/test/new/same_bullet.html new file mode 100644 index 000000000..9220741c0 --- /dev/null +++ b/app/bower_components/marked/test/new/same_bullet.html @@ -0,0 +1,5 @@ +
      +
    • test
    • +
    • test
    • +
    • test
    • +
    diff --git a/app/bower_components/marked/test/new/same_bullet.text b/app/bower_components/marked/test/new/same_bullet.text new file mode 100644 index 000000000..27a89675a --- /dev/null +++ b/app/bower_components/marked/test/new/same_bullet.text @@ -0,0 +1,3 @@ +* test ++ test +- test diff --git a/app/bower_components/marked/test/new/text.smartypants.html b/app/bower_components/marked/test/new/text.smartypants.html new file mode 100644 index 000000000..22997c4c1 --- /dev/null +++ b/app/bower_components/marked/test/new/text.smartypants.html @@ -0,0 +1,6 @@ +

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

    + +

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

    + +

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

    diff --git a/app/bower_components/marked/test/new/text.smartypants.text b/app/bower_components/marked/test/new/text.smartypants.text new file mode 100644 index 000000000..d91c8dc38 --- /dev/null +++ b/app/bower_components/marked/test/new/text.smartypants.text @@ -0,0 +1,6 @@ +Hello world 'how' "are" you -- today... + +"It's a more 'challenging' smartypants test..." + +'And,' as a bonus -- "one +multiline" test! diff --git a/app/bower_components/marked/test/new/toplevel_paragraphs.gfm.html b/app/bower_components/marked/test/new/toplevel_paragraphs.gfm.html new file mode 100644 index 000000000..970c6f19f --- /dev/null +++ b/app/bower_components/marked/test/new/toplevel_paragraphs.gfm.html @@ -0,0 +1,34 @@ +

    hello world + how are you + how are you

    + +

    hello world

    +
    how are you
    + +

    hello world

    +
    + +

    hello world

    +

    how are you

    + +

    hello world

    +

    how are you

    + +

    hello world

    +

    how are you

    + +

    hello world

    +
    • how are you
    + +

    hello world

    +
    how are you
    + +

    hello world +how are you

    + +

    hello world +

    + +
    hello
    + +

    hello

    diff --git a/app/bower_components/marked/test/new/toplevel_paragraphs.gfm.text b/app/bower_components/marked/test/new/toplevel_paragraphs.gfm.text new file mode 100644 index 000000000..66366c07c --- /dev/null +++ b/app/bower_components/marked/test/new/toplevel_paragraphs.gfm.text @@ -0,0 +1,37 @@ +hello world + how are you + how are you + +hello world +``` +how are you +``` + +hello world +* * * + +hello world +# how are you + +hello world +how are you +=========== + +hello world +> how are you + +hello world +* how are you + +hello world +
    how are you
    + +hello world +how are you + +hello [world][how] +[how]: /are/you + +
    hello
    + +hello diff --git a/app/bower_components/marked/test/new/tricky_list.html b/app/bower_components/marked/test/new/tricky_list.html new file mode 100644 index 000000000..764a3352b --- /dev/null +++ b/app/bower_components/marked/test/new/tricky_list.html @@ -0,0 +1,23 @@ +

    hello world

    + +
      +
    • hello world
    • +
    + +

    hello world

    + +
      +
    • hello world
    • +
    + +

    hello world

    + +
      +
    • Hello world
    • +
    + +

    hello world

    + +
      +
    • hello world
    • +
    diff --git a/app/bower_components/marked/test/new/tricky_list.text b/app/bower_components/marked/test/new/tricky_list.text new file mode 100644 index 000000000..9aa76ceb9 --- /dev/null +++ b/app/bower_components/marked/test/new/tricky_list.text @@ -0,0 +1,15 @@ +**hello** _world_ + +* hello world + +**hello** _world_ + +* hello world + +**hello** _world_ + +* Hello world + +**hello** _world_ + +* hello world diff --git a/app/bower_components/marked/test/original/amps_and_angles_encoding.html b/app/bower_components/marked/test/original/amps_and_angles_encoding.html new file mode 100644 index 000000000..9606860b6 --- /dev/null +++ b/app/bower_components/marked/test/original/amps_and_angles_encoding.html @@ -0,0 +1,17 @@ +

    AT&T has an ampersand in their name.

    + +

    AT&T is another way to write it.

    + +

    This & that.

    + +

    4 < 5.

    + +

    6 > 5.

    + +

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

    + +

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

    + +

    Here's an inline link.

    + +

    Here's an inline link.

    diff --git a/app/bower_components/marked/test/original/amps_and_angles_encoding.text b/app/bower_components/marked/test/original/amps_and_angles_encoding.text new file mode 100644 index 000000000..89ec3ae1d --- /dev/null +++ b/app/bower_components/marked/test/original/amps_and_angles_encoding.text @@ -0,0 +1,21 @@ +AT&T has an ampersand in their name. + +AT&T is another way to write it. + +This & that. + +4 < 5. + +6 > 5. + +Here's a [link] [1] with an ampersand in the URL. + +Here's a link with an amersand in the link text: [AT&T] [2]. + +Here's an inline [link](/script?foo=1&bar=2). + +Here's an inline [link](). + + +[1]: http://example.com/?foo=1&bar=2 +[2]: http://att.com/ "AT&T" diff --git a/app/bower_components/marked/test/original/auto_links.html b/app/bower_components/marked/test/original/auto_links.html new file mode 100644 index 000000000..f8df9852c --- /dev/null +++ b/app/bower_components/marked/test/original/auto_links.html @@ -0,0 +1,18 @@ +

    Link: http://example.com/.

    + +

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

    + + + +
    +

    Blockquoted: http://example.com/

    +
    + +

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

    + +
    or here: <http://example.com/>
    +
    diff --git a/app/bower_components/marked/test/original/auto_links.text b/app/bower_components/marked/test/original/auto_links.text new file mode 100644 index 000000000..f85767b48 --- /dev/null +++ b/app/bower_components/marked/test/original/auto_links.text @@ -0,0 +1,13 @@ +Link: . + +With an ampersand: + +* In a list? +* +* It should. + +> Blockquoted: + +Auto-links should not occur here: `` + + or here: diff --git a/app/bower_components/marked/test/original/backslash_escapes.html b/app/bower_components/marked/test/original/backslash_escapes.html new file mode 100644 index 000000000..29870dac5 --- /dev/null +++ b/app/bower_components/marked/test/original/backslash_escapes.html @@ -0,0 +1,118 @@ +

    These should all get escaped:

    + +

    Backslash: \

    + +

    Backtick: `

    + +

    Asterisk: *

    + +

    Underscore: _

    + +

    Left brace: {

    + +

    Right brace: }

    + +

    Left bracket: [

    + +

    Right bracket: ]

    + +

    Left paren: (

    + +

    Right paren: )

    + +

    Greater-than: >

    + +

    Hash: #

    + +

    Period: .

    + +

    Bang: !

    + +

    Plus: +

    + +

    Minus: -

    + +

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

    + +
    Backslash: \\
    +
    +Backtick: \`
    +
    +Asterisk: \*
    +
    +Underscore: \_
    +
    +Left brace: \{
    +
    +Right brace: \}
    +
    +Left bracket: \[
    +
    +Right bracket: \]
    +
    +Left paren: \(
    +
    +Right paren: \)
    +
    +Greater-than: \>
    +
    +Hash: \#
    +
    +Period: \.
    +
    +Bang: \!
    +
    +Plus: \+
    +
    +Minus: \-
    +
    + +

    Nor should these, which occur in code spans:

    + +

    Backslash: \\

    + +

    Backtick: \`

    + +

    Asterisk: \*

    + +

    Underscore: \_

    + +

    Left brace: \{

    + +

    Right brace: \}

    + +

    Left bracket: \[

    + +

    Right bracket: \]

    + +

    Left paren: \(

    + +

    Right paren: \)

    + +

    Greater-than: \>

    + +

    Hash: \#

    + +

    Period: \.

    + +

    Bang: \!

    + +

    Plus: \+

    + +

    Minus: \-

    + + +

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

    + +

    *asterisks*

    + +

    _underscores_

    + +

    `backticks`

    + +

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

    + +

    This is a tag with unescaped backticks bar.

    + +

    This is a tag with backslashes bar.

    diff --git a/app/bower_components/marked/test/original/backslash_escapes.text b/app/bower_components/marked/test/original/backslash_escapes.text new file mode 100644 index 000000000..5b014cb33 --- /dev/null +++ b/app/bower_components/marked/test/original/backslash_escapes.text @@ -0,0 +1,120 @@ +These should all get escaped: + +Backslash: \\ + +Backtick: \` + +Asterisk: \* + +Underscore: \_ + +Left brace: \{ + +Right brace: \} + +Left bracket: \[ + +Right bracket: \] + +Left paren: \( + +Right paren: \) + +Greater-than: \> + +Hash: \# + +Period: \. + +Bang: \! + +Plus: \+ + +Minus: \- + + + +These should not, because they occur within a code block: + + Backslash: \\ + + Backtick: \` + + Asterisk: \* + + Underscore: \_ + + Left brace: \{ + + Right brace: \} + + Left bracket: \[ + + Right bracket: \] + + Left paren: \( + + Right paren: \) + + Greater-than: \> + + Hash: \# + + Period: \. + + Bang: \! + + Plus: \+ + + Minus: \- + + +Nor should these, which occur in code spans: + +Backslash: `\\` + +Backtick: `` \` `` + +Asterisk: `\*` + +Underscore: `\_` + +Left brace: `\{` + +Right brace: `\}` + +Left bracket: `\[` + +Right bracket: `\]` + +Left paren: `\(` + +Right paren: `\)` + +Greater-than: `\>` + +Hash: `\#` + +Period: `\.` + +Bang: `\!` + +Plus: `\+` + +Minus: `\-` + + +These should get escaped, even though they're matching pairs for +other Markdown constructs: + +\*asterisks\* + +\_underscores\_ + +\`backticks\` + +This is a code span with a literal backslash-backtick sequence: `` \` `` + +This is a tag with unescaped backticks bar. + +This is a tag with backslashes bar. diff --git a/app/bower_components/marked/test/original/blockquotes_with_code_blocks.html b/app/bower_components/marked/test/original/blockquotes_with_code_blocks.html new file mode 100644 index 000000000..990202a1b --- /dev/null +++ b/app/bower_components/marked/test/original/blockquotes_with_code_blocks.html @@ -0,0 +1,15 @@ +
    +

    Example:

    + +
    sub status {
    +    print "working";
    +}
    +
    + +

    Or:

    + +
    sub status {
    +    return "working";
    +}
    +
    +
    diff --git a/app/bower_components/marked/test/original/blockquotes_with_code_blocks.text b/app/bower_components/marked/test/original/blockquotes_with_code_blocks.text new file mode 100644 index 000000000..c31d17104 --- /dev/null +++ b/app/bower_components/marked/test/original/blockquotes_with_code_blocks.text @@ -0,0 +1,11 @@ +> Example: +> +> sub status { +> print "working"; +> } +> +> Or: +> +> sub status { +> return "working"; +> } diff --git a/app/bower_components/marked/test/original/code_blocks.html b/app/bower_components/marked/test/original/code_blocks.html new file mode 100644 index 000000000..32703f5cb --- /dev/null +++ b/app/bower_components/marked/test/original/code_blocks.html @@ -0,0 +1,18 @@ +
    code block on the first line
    +
    + +

    Regular text.

    + +
    code block indented by spaces
    +
    + +

    Regular text.

    + +
    the lines in this block  
    +all contain trailing spaces  
    +
    + +

    Regular Text.

    + +
    code block on the last line
    +
    diff --git a/app/bower_components/marked/test/original/code_blocks.text b/app/bower_components/marked/test/original/code_blocks.text new file mode 100644 index 000000000..01f9a733b --- /dev/null +++ b/app/bower_components/marked/test/original/code_blocks.text @@ -0,0 +1,14 @@ + code block on the first line + +Regular text. + + code block indented by spaces + +Regular text. + + the lines in this block + all contain trailing spaces + +Regular Text. + + code block on the last line diff --git a/app/bower_components/marked/test/original/code_spans.html b/app/bower_components/marked/test/original/code_spans.html new file mode 100644 index 000000000..4b8afbb70 --- /dev/null +++ b/app/bower_components/marked/test/original/code_spans.html @@ -0,0 +1,6 @@ +

    <test a=" content of attribute ">

    + +

    Fix for backticks within HTML tag: like this

    + +

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

    + diff --git a/app/bower_components/marked/test/original/code_spans.text b/app/bower_components/marked/test/original/code_spans.text new file mode 100644 index 000000000..750a1973d --- /dev/null +++ b/app/bower_components/marked/test/original/code_spans.text @@ -0,0 +1,6 @@ +`` + +Fix for backticks within HTML tag: like this + +Here's how you put `` `backticks` `` in a code span. + diff --git a/app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.html b/app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.html new file mode 100644 index 000000000..e21ac79a2 --- /dev/null +++ b/app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.html @@ -0,0 +1,8 @@ +

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

    + +

    Here's one with a bullet. +* criminey.

    diff --git a/app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.text b/app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.text new file mode 100644 index 000000000..f8a5b27bf --- /dev/null +++ b/app/bower_components/marked/test/original/hard_wrapped_paragraphs_with_list_like_lines.text @@ -0,0 +1,8 @@ +In Markdown 1.0.0 and earlier. Version +8. This line turns into a list item. +Because a hard-wrapped line in the +middle of a paragraph looked like a +list item. + +Here's one with a bullet. +* criminey. diff --git a/app/bower_components/marked/test/original/horizontal_rules.html b/app/bower_components/marked/test/original/horizontal_rules.html new file mode 100644 index 000000000..2dc2ab656 --- /dev/null +++ b/app/bower_components/marked/test/original/horizontal_rules.html @@ -0,0 +1,71 @@ +

    Dashes:

    + +
    + +
    + +
    + +
    + +
    ---
    +
    + +
    + +
    + +
    + +
    + +
    - - -
    +
    + +

    Asterisks:

    + +
    + +
    + +
    + +
    + +
    ***
    +
    + +
    + +
    + +
    + +
    + +
    * * *
    +
    + +

    Underscores:

    + +
    + +
    + +
    + +
    + +
    ___
    +
    + +
    + +
    + +
    + +
    + +
    _ _ _
    +
    diff --git a/app/bower_components/marked/test/original/horizontal_rules.text b/app/bower_components/marked/test/original/horizontal_rules.text new file mode 100644 index 000000000..1594bda27 --- /dev/null +++ b/app/bower_components/marked/test/original/horizontal_rules.text @@ -0,0 +1,67 @@ +Dashes: + +--- + + --- + + --- + + --- + + --- + +- - - + + - - - + + - - - + + - - - + + - - - + + +Asterisks: + +*** + + *** + + *** + + *** + + *** + +* * * + + * * * + + * * * + + * * * + + * * * + + +Underscores: + +___ + + ___ + + ___ + + ___ + + ___ + +_ _ _ + + _ _ _ + + _ _ _ + + _ _ _ + + _ _ _ diff --git a/app/bower_components/marked/test/original/inline_html_advanced.html b/app/bower_components/marked/test/original/inline_html_advanced.html new file mode 100644 index 000000000..3af9cafb1 --- /dev/null +++ b/app/bower_components/marked/test/original/inline_html_advanced.html @@ -0,0 +1,15 @@ +

    Simple block on one line:

    + +
    foo
    + +

    And nested without indentation:

    + +
    +
    +
    +foo +
    +
    +
    +
    bar
    +
    diff --git a/app/bower_components/marked/test/original/inline_html_advanced.text b/app/bower_components/marked/test/original/inline_html_advanced.text new file mode 100644 index 000000000..86b7206d2 --- /dev/null +++ b/app/bower_components/marked/test/original/inline_html_advanced.text @@ -0,0 +1,15 @@ +Simple block on one line: + +
    foo
    + +And nested without indentation: + +
    +
    +
    +foo +
    +
    +
    +
    bar
    +
    diff --git a/app/bower_components/marked/test/original/inline_html_comments.html b/app/bower_components/marked/test/original/inline_html_comments.html new file mode 100644 index 000000000..3f167a161 --- /dev/null +++ b/app/bower_components/marked/test/original/inline_html_comments.html @@ -0,0 +1,13 @@ +

    Paragraph one.

    + + + + + +

    Paragraph two.

    + + + +

    The end.

    diff --git a/app/bower_components/marked/test/original/inline_html_comments.text b/app/bower_components/marked/test/original/inline_html_comments.text new file mode 100644 index 000000000..41d830d03 --- /dev/null +++ b/app/bower_components/marked/test/original/inline_html_comments.text @@ -0,0 +1,13 @@ +Paragraph one. + + + + + +Paragraph two. + + + +The end. diff --git a/app/bower_components/marked/test/original/inline_html_simple.html b/app/bower_components/marked/test/original/inline_html_simple.html new file mode 100644 index 000000000..6bf78f8fc --- /dev/null +++ b/app/bower_components/marked/test/original/inline_html_simple.html @@ -0,0 +1,72 @@ +

    Here's a simple block:

    + +
    + foo +
    + +

    This should be a code block, though:

    + +
    <div>
    +    foo
    +</div>
    +
    + +

    As should this:

    + +
    <div>foo</div>
    +
    + +

    Now, nested:

    + +
    +
    +
    + foo +
    +
    +
    + +

    This should just be an HTML comment:

    + + + +

    Multiline:

    + + + +

    Code block:

    + +
    <!-- Comment -->
    +
    + +

    Just plain comment, with trailing spaces on the line:

    + + + +

    Code:

    + +
    <hr />
    +
    + +

    Hr's:

    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    diff --git a/app/bower_components/marked/test/original/inline_html_simple.text b/app/bower_components/marked/test/original/inline_html_simple.text new file mode 100644 index 000000000..14aa2dc27 --- /dev/null +++ b/app/bower_components/marked/test/original/inline_html_simple.text @@ -0,0 +1,69 @@ +Here's a simple block: + +
    + foo +
    + +This should be a code block, though: + +
    + foo +
    + +As should this: + +
    foo
    + +Now, nested: + +
    +
    +
    + foo +
    +
    +
    + +This should just be an HTML comment: + + + +Multiline: + + + +Code block: + + + +Just plain comment, with trailing spaces on the line: + + + +Code: + +
    + +Hr's: + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + diff --git a/app/bower_components/marked/test/original/links_inline_style.html b/app/bower_components/marked/test/original/links_inline_style.html new file mode 100644 index 000000000..09df236ed --- /dev/null +++ b/app/bower_components/marked/test/original/links_inline_style.html @@ -0,0 +1,15 @@ +

    Just a URL.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    Empty.

    diff --git a/app/bower_components/marked/test/original/links_inline_style.text b/app/bower_components/marked/test/original/links_inline_style.text new file mode 100644 index 000000000..8c8eb4902 --- /dev/null +++ b/app/bower_components/marked/test/original/links_inline_style.text @@ -0,0 +1,15 @@ +Just a [URL](/url/). + +[URL and title](/url/ "title"). + +[URL and title](/url/ "title preceded by two spaces"). + +[URL and title](/url/ "title preceded by a tab"). + +[URL and title](/url/ "title has spaces afterward" ). + +[URL and title]( /url/has space ). + +[URL and title]( /url/has space/ "url has space and title"). + +[Empty](). diff --git a/app/bower_components/marked/test/original/links_reference_style.html b/app/bower_components/marked/test/original/links_reference_style.html new file mode 100644 index 000000000..8e70c32f4 --- /dev/null +++ b/app/bower_components/marked/test/original/links_reference_style.html @@ -0,0 +1,52 @@ +

    Foo bar.

    + +

    Foo bar.

    + +

    Foo bar.

    + +

    With embedded [brackets].

    + +

    Indented once.

    + +

    Indented twice.

    + +

    Indented thrice.

    + +

    Indented [four][] times.

    + +
    [four]: /url
    +
    + +
    + +

    this should work

    + +

    So should this.

    + +

    And this.

    + +

    And this.

    + +

    And this.

    + +

    But not [that] [].

    + +

    Nor [that][].

    + +

    Nor [that].

    + +

    [Something in brackets like this should work]

    + +

    [Same with this.]

    + +

    In this case, this points to something else.

    + +

    Backslashing should suppress [this] and [this].

    + +
    + +

    Here's one where the link +breaks across lines.

    + +

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

    diff --git a/app/bower_components/marked/test/original/links_reference_style.text b/app/bower_components/marked/test/original/links_reference_style.text new file mode 100644 index 000000000..341ec88e3 --- /dev/null +++ b/app/bower_components/marked/test/original/links_reference_style.text @@ -0,0 +1,71 @@ +Foo [bar] [1]. + +Foo [bar][1]. + +Foo [bar] +[1]. + +[1]: /url/ "Title" + + +With [embedded [brackets]] [b]. + + +Indented [once][]. + +Indented [twice][]. + +Indented [thrice][]. + +Indented [four][] times. + + [once]: /url + + [twice]: /url + + [thrice]: /url + + [four]: /url + + +[b]: /url/ + +* * * + +[this] [this] should work + +So should [this][this]. + +And [this] []. + +And [this][]. + +And [this]. + +But not [that] []. + +Nor [that][]. + +Nor [that]. + +[Something in brackets like [this][] should work] + +[Same with [this].] + +In this case, [this](/somethingelse/) points to something else. + +Backslashing should suppress \[this] and [this\]. + +[this]: foo + + +* * * + +Here's one where the [link +breaks] across lines. + +Here's another where the [link +breaks] across lines, but with a line-ending space. + + +[link breaks]: /url/ diff --git a/app/bower_components/marked/test/original/links_shortcut_references.html b/app/bower_components/marked/test/original/links_shortcut_references.html new file mode 100644 index 000000000..bf81e939f --- /dev/null +++ b/app/bower_components/marked/test/original/links_shortcut_references.html @@ -0,0 +1,9 @@ +

    This is the simple case.

    + +

    This one has a line +break.

    + +

    This one has a line +break with a line-ending space.

    + +

    this and the other

    diff --git a/app/bower_components/marked/test/original/links_shortcut_references.text b/app/bower_components/marked/test/original/links_shortcut_references.text new file mode 100644 index 000000000..8c44c98fe --- /dev/null +++ b/app/bower_components/marked/test/original/links_shortcut_references.text @@ -0,0 +1,20 @@ +This is the [simple case]. + +[simple case]: /simple + + + +This one has a [line +break]. + +This one has a [line +break] with a line-ending space. + +[line break]: /foo + + +[this] [that] and the [other] + +[this]: /this +[that]: /that +[other]: /other diff --git a/app/bower_components/marked/test/original/literal_quotes_in_titles.html b/app/bower_components/marked/test/original/literal_quotes_in_titles.html new file mode 100644 index 000000000..611c1ac61 --- /dev/null +++ b/app/bower_components/marked/test/original/literal_quotes_in_titles.html @@ -0,0 +1,3 @@ +

    Foo bar.

    + +

    Foo bar.

    diff --git a/app/bower_components/marked/test/original/literal_quotes_in_titles.text b/app/bower_components/marked/test/original/literal_quotes_in_titles.text new file mode 100644 index 000000000..29d0e4235 --- /dev/null +++ b/app/bower_components/marked/test/original/literal_quotes_in_titles.text @@ -0,0 +1,7 @@ +Foo [bar][]. + +Foo [bar](/url/ "Title with "quotes" inside"). + + + [bar]: /url/ "Title with "quotes" inside" + diff --git a/app/bower_components/marked/test/original/markdown_documentation_basics.html b/app/bower_components/marked/test/original/markdown_documentation_basics.html new file mode 100644 index 000000000..d5bdbb29a --- /dev/null +++ b/app/bower_components/marked/test/original/markdown_documentation_basics.html @@ -0,0 +1,314 @@ +

    Markdown: Basics

    + + + +

    Getting the Gist of Markdown's Formatting Syntax

    + +

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

    + +

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

    + +

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

    + +

    Paragraphs, Headers, Blockquotes

    + +

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

    + +

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

    + +

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

    + +

    Markdown:

    + +
    A First Level Header
    +====================
    +
    +A Second Level Header
    +---------------------
    +
    +Now is the time for all good men to come to
    +the aid of their country. This is just a
    +regular paragraph.
    +
    +The quick brown fox jumped over the lazy
    +dog's back.
    +
    +### Header 3
    +
    +> This is a blockquote.
    +> 
    +> This is the second paragraph in the blockquote.
    +>
    +> ## This is an H2 in a blockquote
    +
    + +

    Output:

    + +
    <h1>A First Level Header</h1>
    +
    +<h2>A Second Level Header</h2>
    +
    +<p>Now is the time for all good men to come to
    +the aid of their country. This is just a
    +regular paragraph.</p>
    +
    +<p>The quick brown fox jumped over the lazy
    +dog's back.</p>
    +
    +<h3>Header 3</h3>
    +
    +<blockquote>
    +    <p>This is a blockquote.</p>
    +
    +    <p>This is the second paragraph in the blockquote.</p>
    +
    +    <h2>This is an H2 in a blockquote</h2>
    +</blockquote>
    +
    + +

    Phrase Emphasis

    + +

    Markdown uses asterisks and underscores to indicate spans of emphasis.

    + +

    Markdown:

    + +
    Some of these words *are emphasized*.
    +Some of these words _are emphasized also_.
    +
    +Use two asterisks for **strong emphasis**.
    +Or, if you prefer, __use two underscores instead__.
    +
    + +

    Output:

    + +
    <p>Some of these words <em>are emphasized</em>.
    +Some of these words <em>are emphasized also</em>.</p>
    +
    +<p>Use two asterisks for <strong>strong emphasis</strong>.
    +Or, if you prefer, <strong>use two underscores instead</strong>.</p>
    +
    + +

    Lists

    + +

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

    + +
    *   Candy.
    +*   Gum.
    +*   Booze.
    +
    + +

    this:

    + +
    +   Candy.
    ++   Gum.
    ++   Booze.
    +
    + +

    and this:

    + +
    -   Candy.
    +-   Gum.
    +-   Booze.
    +
    + +

    all produce the same output:

    + +
    <ul>
    +<li>Candy.</li>
    +<li>Gum.</li>
    +<li>Booze.</li>
    +</ul>
    +
    + +

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

    + +
    1.  Red
    +2.  Green
    +3.  Blue
    +
    + +

    Output:

    + +
    <ol>
    +<li>Red</li>
    +<li>Green</li>
    +<li>Blue</li>
    +</ol>
    +
    + +

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

    + +
    *   A list item.
    +
    +    With multiple paragraphs.
    +
    +*   Another item in the list.
    +
    + +

    Output:

    + +
    <ul>
    +<li><p>A list item.</p>
    +<p>With multiple paragraphs.</p></li>
    +<li><p>Another item in the list.</p></li>
    +</ul>
    +
    + +

    Links

    + +

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

    + +

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

    + +
    This is an [example link](http://example.com/).
    +
    + +

    Output:

    + +
    <p>This is an <a href="http://example.com/">
    +example link</a>.</p>
    +
    + +

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

    + +
    This is an [example link](http://example.com/ "With a Title").
    +
    + +

    Output:

    + +
    <p>This is an <a href="http://example.com/" title="With a Title">
    +example link</a>.</p>
    +
    + +

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

    + +
    I get 10 times more traffic from [Google][1] than from
    +[Yahoo][2] or [MSN][3].
    +
    +[1]: http://google.com/        "Google"
    +[2]: http://search.yahoo.com/  "Yahoo Search"
    +[3]: http://search.msn.com/    "MSN Search"
    +
    + +

    Output:

    + +
    <p>I get 10 times more traffic from <a href="http://google.com/"
    +title="Google">Google</a> than from <a href="http://search.yahoo.com/"
    +title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
    +title="MSN Search">MSN</a>.</p>
    +
    + +

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

    + +
    I start my morning with a cup of coffee and
    +[The New York Times][NY Times].
    +
    +[ny times]: http://www.nytimes.com/
    +
    + +

    Output:

    + +
    <p>I start my morning with a cup of coffee and
    +<a href="http://www.nytimes.com/">The New York Times</a>.</p>
    +
    + +

    Images

    + +

    Image syntax is very much like link syntax.

    + +

    Inline (titles are optional):

    + +
    ![alt text](/path/to/img.jpg "Title")
    +
    + +

    Reference-style:

    + +
    ![alt text][id]
    +
    +[id]: /path/to/img.jpg "Title"
    +
    + +

    Both of the above examples produce the same output:

    + +
    <img src="/path/to/img.jpg" alt="alt text" title="Title" />
    +
    + +

    Code

    + +

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

    + +
    I strongly recommend against using any `<blink>` tags.
    +
    +I wish SmartyPants used named entities like `&mdash;`
    +instead of decimal-encoded entites like `&#8212;`.
    +
    + +

    Output:

    + +
    <p>I strongly recommend against using any
    +<code>&lt;blink&gt;</code> tags.</p>
    +
    +<p>I wish SmartyPants used named entities like
    +<code>&amp;mdash;</code> instead of decimal-encoded
    +entites like <code>&amp;#8212;</code>.</p>
    +
    + +

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

    + +

    Markdown:

    + +
    If you want your page to validate under XHTML 1.0 Strict,
    +you've got to put paragraph tags in your blockquotes:
    +
    +    <blockquote>
    +        <p>For example.</p>
    +    </blockquote>
    +
    + +

    Output:

    + +
    <p>If you want your page to validate under XHTML 1.0 Strict,
    +you've got to put paragraph tags in your blockquotes:</p>
    +
    +<pre><code>&lt;blockquote&gt;
    +    &lt;p&gt;For example.&lt;/p&gt;
    +&lt;/blockquote&gt;
    +</code></pre>
    +
    diff --git a/app/bower_components/marked/test/original/markdown_documentation_basics.text b/app/bower_components/marked/test/original/markdown_documentation_basics.text new file mode 100644 index 000000000..486055ca7 --- /dev/null +++ b/app/bower_components/marked/test/original/markdown_documentation_basics.text @@ -0,0 +1,306 @@ +Markdown: Basics +================ + + + + +Getting the Gist of Markdown's Formatting Syntax +------------------------------------------------ + +This page offers a brief overview of what it's like to use Markdown. +The [syntax page] [s] provides complete, detailed documentation for +every feature, but Markdown should be very easy to pick up simply by +looking at a few examples of it in action. The examples on this page +are written in a before/after style, showing example syntax and the +HTML output produced by Markdown. + +It's also helpful to simply try Markdown out; the [Dingus] [d] is a +web application that allows you type your own Markdown-formatted text +and translate it to XHTML. + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL] [src]. + + [s]: /projects/markdown/syntax "Markdown Syntax" + [d]: /projects/markdown/dingus "Markdown Dingus" + [src]: /projects/markdown/basics.text + + +## Paragraphs, Headers, Blockquotes ## + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +Markdown offers two styles of headers: *Setext* and *atx*. +Setext-style headers for `

    ` and `

    ` are created by +"underlining" with equal signs (`=`) and hyphens (`-`), respectively. +To create an atx-style header, you put 1-6 hash marks (`#`) at the +beginning of the line -- the number of hashes equals the resulting +HTML header level. + +Blockquotes are indicated using email-style '`>`' angle brackets. + +Markdown: + + A First Level Header + ==================== + + A Second Level Header + --------------------- + + Now is the time for all good men to come to + the aid of their country. This is just a + regular paragraph. + + The quick brown fox jumped over the lazy + dog's back. + + ### Header 3 + + > This is a blockquote. + > + > This is the second paragraph in the blockquote. + > + > ## This is an H2 in a blockquote + + +Output: + +

    A First Level Header

    + +

    A Second Level Header

    + +

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

    + +

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

    + +

    Header 3

    + +
    +

    This is a blockquote.

    + +

    This is the second paragraph in the blockquote.

    + +

    This is an H2 in a blockquote

    +
    + + + +### Phrase Emphasis ### + +Markdown uses asterisks and underscores to indicate spans of emphasis. + +Markdown: + + Some of these words *are emphasized*. + Some of these words _are emphasized also_. + + Use two asterisks for **strong emphasis**. + Or, if you prefer, __use two underscores instead__. + +Output: + +

    Some of these words are emphasized. + Some of these words are emphasized also.

    + +

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

    + + + +## Lists ## + +Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, +`+`, and `-`) as list markers. These three markers are +interchangable; this: + + * Candy. + * Gum. + * Booze. + +this: + + + Candy. + + Gum. + + Booze. + +and this: + + - Candy. + - Gum. + - Booze. + +all produce the same output: + +
      +
    • Candy.
    • +
    • Gum.
    • +
    • Booze.
    • +
    + +Ordered (numbered) lists use regular numbers, followed by periods, as +list markers: + + 1. Red + 2. Green + 3. Blue + +Output: + +
      +
    1. Red
    2. +
    3. Green
    4. +
    5. Blue
    6. +
    + +If you put blank lines between items, you'll get `

    ` tags for the +list item text. You can create multi-paragraph list items by indenting +the paragraphs by 4 spaces or 1 tab: + + * A list item. + + With multiple paragraphs. + + * Another item in the list. + +Output: + +

      +
    • A list item.

      +

      With multiple paragraphs.

    • +
    • Another item in the list.

    • +
    + + + +### Links ### + +Markdown supports two styles for creating links: *inline* and +*reference*. With both styles, you use square brackets to delimit the +text you want to turn into a link. + +Inline-style links use parentheses immediately after the link text. +For example: + + This is an [example link](http://example.com/). + +Output: + +

    This is an + example link.

    + +Optionally, you may include a title attribute in the parentheses: + + This is an [example link](http://example.com/ "With a Title"). + +Output: + +

    This is an + example link.

    + +Reference-style links allow you to refer to your links by names, which +you define elsewhere in your document: + + I get 10 times more traffic from [Google][1] than from + [Yahoo][2] or [MSN][3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Output: + +

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

    + +The title attribute is optional. Link names may contain letters, +numbers and spaces, but are *not* case sensitive: + + I start my morning with a cup of coffee and + [The New York Times][NY Times]. + + [ny times]: http://www.nytimes.com/ + +Output: + +

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

    + + +### Images ### + +Image syntax is very much like link syntax. + +Inline (titles are optional): + + ![alt text](/path/to/img.jpg "Title") + +Reference-style: + + ![alt text][id] + + [id]: /path/to/img.jpg "Title" + +Both of the above examples produce the same output: + + alt text + + + +### Code ### + +In a regular paragraph, you can create code span by wrapping text in +backtick quotes. Any ampersands (`&`) and angle brackets (`<` or +`>`) will automatically be translated into HTML entities. This makes +it easy to use Markdown to write about HTML example code: + + I strongly recommend against using any `` tags. + + I wish SmartyPants used named entities like `—` + instead of decimal-encoded entites like `—`. + +Output: + +

    I strongly recommend against using any + <blink> tags.

    + +

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

    + + +To specify an entire block of pre-formatted code, indent every line of +the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, +and `>` characters will be escaped automatically. + +Markdown: + + If you want your page to validate under XHTML 1.0 Strict, + you've got to put paragraph tags in your blockquotes: + +
    +

    For example.

    +
    + +Output: + +

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

    + +
    <blockquote>
    +        <p>For example.</p>
    +    </blockquote>
    +    
    diff --git a/app/bower_components/marked/test/original/markdown_documentation_syntax.html b/app/bower_components/marked/test/original/markdown_documentation_syntax.html new file mode 100644 index 000000000..5c01306cc --- /dev/null +++ b/app/bower_components/marked/test/original/markdown_documentation_syntax.html @@ -0,0 +1,942 @@ +

    Markdown: Syntax

    + + + + + +

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

    + +
    + +

    Overview

    + +

    Philosophy

    + +

    Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

    + +

    Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including Setext, atx, Textile, reStructuredText, +Grutatext, and EtText -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email.

    + +

    To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like *emphasis*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email.

    + +

    Inline HTML

    + +

    Markdown's syntax is intended for one purpose: to be used as a +format for writing for the web.

    + +

    Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is not to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a publishing format; Markdown is a writing +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text.

    + +

    For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags.

    + +

    The only restrictions are that block-level HTML elements -- e.g. <div>, +<table>, <pre>, <p>, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) <p> tags around HTML block-level tags.

    + +

    For example, to add an HTML table to a Markdown article:

    + +
    This is a regular paragraph.
    +
    +<table>
    +    <tr>
    +        <td>Foo</td>
    +    </tr>
    +</table>
    +
    +This is another regular paragraph.
    +
    + +

    Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style *emphasis* inside an +HTML block.

    + +

    Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML <a> or <img> tags instead of Markdown's +link or image syntax, go right ahead.

    + +

    Unlike block-level HTML tags, Markdown syntax is processed within +span-level tags.

    + +

    Automatic Escaping for Special Characters

    + +

    In HTML, there are two characters that demand special treatment: < +and &. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. &lt;, and +&amp;.

    + +

    Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write 'AT&amp;T'. You even need to +escape ampersands within URLs. Thus, if you want to link to:

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

    you need to encode the URL as:

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

    in your anchor tag href attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites.

    + +

    Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into &amp;.

    + +

    So, if you want to include a copyright symbol in your article, you can write:

    + +
    &copy;
    +
    + +

    and Markdown will leave it alone. But if you write:

    + +
    AT&T
    +
    + +

    Markdown will translate it to:

    + +
    AT&amp;T
    +
    + +

    Similarly, because Markdown supports inline HTML, if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write:

    + +
    4 < 5
    +
    + +

    Markdown will translate it to:

    + +
    4 &lt; 5
    +
    + +

    However, inside Markdown code spans and blocks, angle brackets and +ampersands are always encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single < +and & in your example code needs to be escaped.)

    + +
    + +

    Block Elements

    + +

    Paragraphs and Line Breaks

    + +

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

    + +

    The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a <br /> tag.

    + +

    When you do want to insert a <br /> break tag using Markdown, you +end a line with two or more spaces, then type return.

    + +

    Yes, this takes a tad more effort to create a <br />, but a simplistic +"every line break is a <br />" rule wouldn't work for Markdown. +Markdown's email-style blockquoting and multi-paragraph list items +work best -- and look better -- when you format them with hard breaks.

    + + + +

    Markdown supports two styles of headers, Setext and atx.

    + +

    Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example:

    + +
    This is an H1
    +=============
    +
    +This is an H2
    +-------------
    +
    + +

    Any number of underlining ='s or -'s will work.

    + +

    Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example:

    + +
    # This is an H1
    +
    +## This is an H2
    +
    +###### This is an H6
    +
    + +

    Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) :

    + +
    # This is an H1 #
    +
    +## This is an H2 ##
    +
    +### This is an H3 ######
    +
    + +

    Blockquotes

    + +

    Markdown uses email-style > characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a > before every line:

    + +
    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    +> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    +> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    +> 
    +> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    +> id sem consectetuer libero luctus adipiscing.
    +
    + +

    Markdown allows you to be lazy and only put the > before the first +line of a hard-wrapped paragraph:

    + +
    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    +consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    +Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    +
    +> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    +id sem consectetuer libero luctus adipiscing.
    +
    + +

    Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of >:

    + +
    > This is the first level of quoting.
    +>
    +> > This is nested blockquote.
    +>
    +> Back to the first level.
    +
    + +

    Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks:

    + +
    > ## This is a header.
    +> 
    +> 1.   This is the first list item.
    +> 2.   This is the second list item.
    +> 
    +> Here's some example code:
    +> 
    +>     return shell_exec("echo $input | $markdown_script");
    +
    + +

    Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu.

    + +

    Lists

    + +

    Markdown supports ordered (numbered) and unordered (bulleted) lists.

    + +

    Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers:

    + +
    *   Red
    +*   Green
    +*   Blue
    +
    + +

    is equivalent to:

    + +
    +   Red
    ++   Green
    ++   Blue
    +
    + +

    and:

    + +
    -   Red
    +-   Green
    +-   Blue
    +
    + +

    Ordered lists use numbers followed by periods:

    + +
    1.  Bird
    +2.  McHale
    +3.  Parish
    +
    + +

    It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is:

    + +
    <ol>
    +<li>Bird</li>
    +<li>McHale</li>
    +<li>Parish</li>
    +</ol>
    +
    + +

    If you instead wrote the list in Markdown like this:

    + +
    1.  Bird
    +1.  McHale
    +1.  Parish
    +
    + +

    or even:

    + +
    3. Bird
    +1. McHale
    +8. Parish
    +
    + +

    you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to.

    + +

    If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number.

    + +

    List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab.

    + +

    To make lists look nice, you can wrap items with hanging indents:

    + +
    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    +    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    +    viverra nec, fringilla in, laoreet vitae, risus.
    +*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    +    Suspendisse id sem consectetuer libero luctus adipiscing.
    +
    + +

    But if you want to be lazy, you don't have to:

    + +
    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    +Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    +viverra nec, fringilla in, laoreet vitae, risus.
    +*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    +Suspendisse id sem consectetuer libero luctus adipiscing.
    +
    + +

    If list items are separated by blank lines, Markdown will wrap the +items in <p> tags in the HTML output. For example, this input:

    + +
    *   Bird
    +*   Magic
    +
    + +

    will turn into:

    + +
    <ul>
    +<li>Bird</li>
    +<li>Magic</li>
    +</ul>
    +
    + +

    But this:

    + +
    *   Bird
    +
    +*   Magic
    +
    + +

    will turn into:

    + +
    <ul>
    +<li><p>Bird</p></li>
    +<li><p>Magic</p></li>
    +</ul>
    +
    + +

    List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab:

    + +
    1.  This is a list item with two paragraphs. Lorem ipsum dolor
    +    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    +    mi posuere lectus.
    +
    +    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    +    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    +    sit amet velit.
    +
    +2.  Suspendisse id sem consectetuer libero luctus adipiscing.
    +
    + +

    It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy:

    + +
    *   This is a list item with two paragraphs.
    +
    +    This is the second paragraph in the list item. You're
    +only required to indent the first line. Lorem ipsum dolor
    +sit amet, consectetuer adipiscing elit.
    +
    +*   Another item in the same list.
    +
    + +

    To put a blockquote within a list item, the blockquote's > +delimiters need to be indented:

    + +
    *   A list item with a blockquote:
    +
    +    > This is a blockquote
    +    > inside a list item.
    +
    + +

    To put a code block within a list item, the code block needs +to be indented twice -- 8 spaces or two tabs:

    + +
    *   A list item with a code block:
    +
    +        <code goes here>
    +
    + +

    It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this:

    + +
    1986. What a great season.
    +
    + +

    In other words, a number-period-space sequence at the beginning of a +line. To avoid this, you can backslash-escape the period:

    + +
    1986\. What a great season.
    +
    + +

    Code Blocks

    + +

    Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both <pre> and <code> tags.

    + +

    To produce a code block in Markdown, simply indent every line of the +block by at least 4 spaces or 1 tab. For example, given this input:

    + +
    This is a normal paragraph:
    +
    +    This is a code block.
    +
    + +

    Markdown will generate:

    + +
    <p>This is a normal paragraph:</p>
    +
    +<pre><code>This is a code block.
    +</code></pre>
    +
    + +

    One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this:

    + +
    Here is an example of AppleScript:
    +
    +    tell application "Foo"
    +        beep
    +    end tell
    +
    + +

    will turn into:

    + +
    <p>Here is an example of AppleScript:</p>
    +
    +<pre><code>tell application "Foo"
    +    beep
    +end tell
    +</code></pre>
    +
    + +

    A code block continues until it reaches a line that is not indented +(or the end of the article).

    + +

    Within a code block, ampersands (&) and angle brackets (< and >) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this:

    + +
        <div class="footer">
    +        &copy; 2004 Foo Corporation
    +    </div>
    +
    + +

    will turn into:

    + +
    <pre><code>&lt;div class="footer"&gt;
    +    &amp;copy; 2004 Foo Corporation
    +&lt;/div&gt;
    +</code></pre>
    +
    + +

    Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax.

    + +

    Horizontal Rules

    + +

    You can produce a horizontal rule tag (<hr />) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule:

    + +
    * * *
    +
    +***
    +
    +*****
    +
    +- - -
    +
    +---------------------------------------
    +
    +_ _ _
    +
    + +
    + +

    Span Elements

    + + + +

    Markdown supports two style of links: inline and reference.

    + +

    In both styles, the link text is delimited by [square brackets].

    + +

    To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an optional +title for the link, surrounded in quotes. For example:

    + +
    This is [an example](http://example.com/ "Title") inline link.
    +
    +[This link](http://example.net/) has no title attribute.
    +
    + +

    Will produce:

    + +
    <p>This is <a href="http://example.com/" title="Title">
    +an example</a> inline link.</p>
    +
    +<p><a href="http://example.net/">This link</a> has no
    +title attribute.</p>
    +
    + +

    If you're referring to a local resource on the same server, you can +use relative paths:

    + +
    See my [About](/about/) page for details.
    +
    + +

    Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link:

    + +
    This is [an example][id] reference-style link.
    +
    + +

    You can optionally use a space to separate the sets of brackets:

    + +
    This is [an example] [id] reference-style link.
    +
    + +

    Then, anywhere in the document, you define your link label like this, +on a line by itself:

    + +
    [id]: http://example.com/  "Optional Title Here"
    +
    + +

    That is:

    + +
      +
    • Square brackets containing the link identifier (optionally +indented from the left margin using up to three spaces);
    • +
    • followed by a colon;
    • +
    • followed by one or more spaces (or tabs);
    • +
    • followed by the URL for the link;
    • +
    • optionally followed by a title attribute for the link, enclosed +in double or single quotes.
    • +
    + +

    The link URL may, optionally, be surrounded by angle brackets:

    + +
    [id]: <http://example.com/>  "Optional Title Here"
    +
    + +

    You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs:

    + +
    [id]: http://example.com/longish/path/to/resource/here
    +    "Optional Title Here"
    +
    + +

    Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output.

    + +

    Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

    + +
    [link text][a]
    +[link text][A]
    +
    + +

    are equivalent.

    + +

    The implicit link name shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write:

    + +
    [Google][]
    +
    + +

    And then define the link:

    + +
    [Google]: http://google.com/
    +
    + +

    Because link names may contain spaces, this shortcut even works for +multiple words in the link text:

    + +
    Visit [Daring Fireball][] for more information.
    +
    + +

    And then define the link:

    + +
    [Daring Fireball]: http://daringfireball.net/
    +
    + +

    Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes.

    + +

    Here's an example of reference links in action:

    + +
    I get 10 times more traffic from [Google] [1] than from
    +[Yahoo] [2] or [MSN] [3].
    +
    +  [1]: http://google.com/        "Google"
    +  [2]: http://search.yahoo.com/  "Yahoo Search"
    +  [3]: http://search.msn.com/    "MSN Search"
    +
    + +

    Using the implicit link name shortcut, you could instead write:

    + +
    I get 10 times more traffic from [Google][] than from
    +[Yahoo][] or [MSN][].
    +
    +  [google]: http://google.com/        "Google"
    +  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
    +  [msn]:    http://search.msn.com/    "MSN Search"
    +
    + +

    Both of the above examples will produce the following HTML output:

    + +
    <p>I get 10 times more traffic from <a href="http://google.com/"
    +title="Google">Google</a> than from
    +<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
    +or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
    +
    + +

    For comparison, here is the same paragraph written using +Markdown's inline link style:

    + +
    I get 10 times more traffic from [Google](http://google.com/ "Google")
    +than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
    +[MSN](http://search.msn.com/ "MSN Search").
    +
    + +

    The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text.

    + +

    With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose.

    + +

    Emphasis

    + +

    Markdown treats asterisks (*) and underscores (_) as indicators of +emphasis. Text wrapped with one * or _ will be wrapped with an +HTML <em> tag; double *'s or _'s will be wrapped with an HTML +<strong> tag. E.g., this input:

    + +
    *single asterisks*
    +
    +_single underscores_
    +
    +**double asterisks**
    +
    +__double underscores__
    +
    + +

    will produce:

    + +
    <em>single asterisks</em>
    +
    +<em>single underscores</em>
    +
    +<strong>double asterisks</strong>
    +
    +<strong>double underscores</strong>
    +
    + +

    You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span.

    + +

    Emphasis can be used in the middle of a word:

    + +
    un*fucking*believable
    +
    + +

    But if you surround an * or _ with spaces, it'll be treated as a +literal asterisk or underscore.

    + +

    To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it:

    + +
    \*this text is surrounded by literal asterisks\*
    +
    + +

    Code

    + +

    To indicate a span of code, wrap it with backtick quotes (`). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example:

    + +
    Use the `printf()` function.
    +
    + +

    will produce:

    + +
    <p>Use the <code>printf()</code> function.</p>
    +
    + +

    To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters:

    + +
    ``There is a literal backtick (`) here.``
    +
    + +

    which will produce this:

    + +
    <p><code>There is a literal backtick (`) here.</code></p>
    +
    + +

    The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span:

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

    will produce:

    + +
    <p>A single backtick in a code span: <code>`</code></p>
    +
    +<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
    +
    + +

    With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this:

    + +
    Please don't use any `<blink>` tags.
    +
    + +

    into:

    + +
    <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
    +
    + +

    You can write this:

    + +
    `&#8212;` is the decimal-encoded equivalent of `&mdash;`.
    +
    + +

    to produce:

    + +
    <p><code>&amp;#8212;</code> is the decimal-encoded
    +equivalent of <code>&amp;mdash;</code>.</p>
    +
    + +

    Images

    + +

    Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format.

    + +

    Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: inline and reference.

    + +

    Inline image syntax looks like this:

    + +
    ![Alt text](/path/to/img.jpg)
    +
    +![Alt text](/path/to/img.jpg "Optional title")
    +
    + +

    That is:

    + +
      +
    • An exclamation mark: !;
    • +
    • followed by a set of square brackets, containing the alt +attribute text for the image;
    • +
    • followed by a set of parentheses, containing the URL or path to +the image, and an optional title attribute enclosed in double +or single quotes.
    • +
    + +

    Reference-style image syntax looks like this:

    + +
    ![Alt text][id]
    +
    + +

    Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references:

    + +
    [id]: url/to/image  "Optional title attribute"
    +
    + +

    As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML <img> tags.

    + +
    + +

    Miscellaneous

    + + + +

    Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

    + +
    <http://example.com/>
    +
    + +

    Markdown will turn this into:

    + +
    <a href="http://example.com/">http://example.com/</a>
    +
    + +

    Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this:

    + +
    <address@example.com>
    +
    + +

    into something like this:

    + +
    <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
    +&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
    +&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
    +&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
    +
    + +

    which will render in a browser as a clickable link to "address@example.com".

    + +

    (This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.)

    + +

    Backslash Escapes

    + +

    Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML <em> tag), you can backslashes +before the asterisks, like this:

    + +
    \*literal asterisks\*
    +
    + +

    Markdown provides backslash escapes for the following characters:

    + +
    \   backslash
    +`   backtick
    +*   asterisk
    +_   underscore
    +{}  curly braces
    +[]  square brackets
    +()  parentheses
    +#   hash mark
    ++   plus sign
    +-   minus sign (hyphen)
    +.   dot
    +!   exclamation mark
    +
    diff --git a/app/bower_components/marked/test/original/markdown_documentation_syntax.text b/app/bower_components/marked/test/original/markdown_documentation_syntax.text new file mode 100644 index 000000000..57360a16c --- /dev/null +++ b/app/bower_components/marked/test/original/markdown_documentation_syntax.text @@ -0,0 +1,888 @@ +Markdown: Syntax +================ + + + + +* [Overview](#overview) + * [Philosophy](#philosophy) + * [Inline HTML](#html) + * [Automatic Escaping for Special Characters](#autoescape) +* [Block Elements](#block) + * [Paragraphs and Line Breaks](#p) + * [Headers](#header) + * [Blockquotes](#blockquote) + * [Lists](#list) + * [Code Blocks](#precode) + * [Horizontal Rules](#hr) +* [Span Elements](#span) + * [Links](#link) + * [Emphasis](#em) + * [Code](#code) + * [Images](#img) +* [Miscellaneous](#misc) + * [Backslash Escapes](#backslash) + * [Automatic Links](#autolink) + + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL][src]. + + [src]: /projects/markdown/syntax.text + +* * * + +

    Overview

    + +

    Philosophy

    + +Markdown is intended to be as easy-to-read and easy-to-write as is feasible. + +Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], +[Grutatext] [5], and [EtText] [6] -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email. + + [1]: http://docutils.sourceforge.net/mirror/setext.html + [2]: http://www.aaronsw.com/2002/atx/ + [3]: http://textism.com/tools/textile/ + [4]: http://docutils.sourceforge.net/rst.html + [5]: http://www.triptico.com/software/grutatxt.html + [6]: http://ettext.taint.org/doc/ + +To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like \*emphasis\*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email. + + + +

    Inline HTML

    + +Markdown's syntax is intended for one purpose: to be used as a +format for *writing* for the web. + +Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is *not* to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a *publishing* format; Markdown is a *writing* +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text. + +For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags. + +The only restrictions are that block-level HTML elements -- e.g. `
    `, +``, `
    `, `

    `, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) `

    ` tags around HTML block-level tags. + +For example, to add an HTML table to a Markdown article: + + This is a regular paragraph. + +

    + + + +
    Foo
    + + This is another regular paragraph. + +Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an +HTML block. + +Span-level HTML tags -- e.g. ``, ``, or `` -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML `` or `` tags instead of Markdown's +link or image syntax, go right ahead. + +Unlike block-level HTML tags, Markdown syntax *is* processed within +span-level tags. + + +

    Automatic Escaping for Special Characters

    + +In HTML, there are two characters that demand special treatment: `<` +and `&`. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. `<`, and +`&`. + +Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write '`AT&T`'. You even need to +escape ampersands within URLs. Thus, if you want to link to: + + http://images.google.com/images?num=30&q=larry+bird + +you need to encode the URL as: + + http://images.google.com/images?num=30&q=larry+bird + +in your anchor tag `href` attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites. + +Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into `&`. + +So, if you want to include a copyright symbol in your article, you can write: + + © + +and Markdown will leave it alone. But if you write: + + AT&T + +Markdown will translate it to: + + AT&T + +Similarly, because Markdown supports [inline HTML](#html), if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write: + + 4 < 5 + +Markdown will translate it to: + + 4 < 5 + +However, inside Markdown code spans and blocks, angle brackets and +ampersands are *always* encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single `<` +and `&` in your example code needs to be escaped.) + + +* * * + + +

    Block Elements

    + + +

    Paragraphs and Line Breaks

    + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing but spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a `
    ` tag. + +When you *do* want to insert a `
    ` break tag using Markdown, you +end a line with two or more spaces, then type return. + +Yes, this takes a tad more effort to create a `
    `, but a simplistic +"every line break is a `
    `" rule wouldn't work for Markdown. +Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] +work best -- and look better -- when you format them with hard breaks. + + [bq]: #blockquote + [l]: #list + + + + + +Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. + +Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example: + + This is an H1 + ============= + + This is an H2 + ------------- + +Any number of underlining `=`'s or `-`'s will work. + +Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example: + + # This is an H1 + + ## This is an H2 + + ###### This is an H6 + +Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) : + + # This is an H1 # + + ## This is an H2 ## + + ### This is an H3 ###### + + +

    Blockquotes

    + +Markdown uses email-style `>` characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a `>` before every line: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + > + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + > id sem consectetuer libero luctus adipiscing. + +Markdown allows you to be lazy and only put the `>` before the first +line of a hard-wrapped paragraph: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + id sem consectetuer libero luctus adipiscing. + +Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of `>`: + + > This is the first level of quoting. + > + > > This is nested blockquote. + > + > Back to the first level. + +Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks: + + > ## This is a header. + > + > 1. This is the first list item. + > 2. This is the second list item. + > + > Here's some example code: + > + > return shell_exec("echo $input | $markdown_script"); + +Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu. + + +

    Lists

    + +Markdown supports ordered (numbered) and unordered (bulleted) lists. + +Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers: + + * Red + * Green + * Blue + +is equivalent to: + + + Red + + Green + + Blue + +and: + + - Red + - Green + - Blue + +Ordered lists use numbers followed by periods: + + 1. Bird + 2. McHale + 3. Parish + +It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is: + +
      +
    1. Bird
    2. +
    3. McHale
    4. +
    5. Parish
    6. +
    + +If you instead wrote the list in Markdown like this: + + 1. Bird + 1. McHale + 1. Parish + +or even: + + 3. Bird + 1. McHale + 8. Parish + +you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to. + +If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number. + +List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab. + +To make lists look nice, you can wrap items with hanging indents: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +But if you want to be lazy, you don't have to: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +If list items are separated by blank lines, Markdown will wrap the +items in `

    ` tags in the HTML output. For example, this input: + + * Bird + * Magic + +will turn into: + +

      +
    • Bird
    • +
    • Magic
    • +
    + +But this: + + * Bird + + * Magic + +will turn into: + +
      +
    • Bird

    • +
    • Magic

    • +
    + +List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab: + + 1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + Vestibulum enim wisi, viverra nec, fringilla in, laoreet + vitae, risus. Donec sit amet nisl. Aliquam semper ipsum + sit amet velit. + + 2. Suspendisse id sem consectetuer libero luctus adipiscing. + +It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy: + + * This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're + only required to indent the first line. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. + + * Another item in the same list. + +To put a blockquote within a list item, the blockquote's `>` +delimiters need to be indented: + + * A list item with a blockquote: + + > This is a blockquote + > inside a list item. + +To put a code block within a list item, the code block needs +to be indented *twice* -- 8 spaces or two tabs: + + * A list item with a code block: + + + + +It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this: + + 1986. What a great season. + +In other words, a *number-period-space* sequence at the beginning of a +line. To avoid this, you can backslash-escape the period: + + 1986\. What a great season. + + + +

    Code Blocks

    + +Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both `
    ` and `` tags.
    +
    +To produce a code block in Markdown, simply indent every line of the
    +block by at least 4 spaces or 1 tab. For example, given this input:
    +
    +    This is a normal paragraph:
    +
    +        This is a code block.
    +
    +Markdown will generate:
    +
    +    

    This is a normal paragraph:

    + +
    This is a code block.
    +    
    + +One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this: + + Here is an example of AppleScript: + + tell application "Foo" + beep + end tell + +will turn into: + +

    Here is an example of AppleScript:

    + +
    tell application "Foo"
    +        beep
    +    end tell
    +    
    + +A code block continues until it reaches a line that is not indented +(or the end of the article). + +Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this: + + + +will turn into: + +
    <div class="footer">
    +        &copy; 2004 Foo Corporation
    +    </div>
    +    
    + +Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax. + + + +

    Horizontal Rules

    + +You can produce a horizontal rule tag (`
    `) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule: + + * * * + + *** + + ***** + + - - - + + --------------------------------------- + + _ _ _ + + +* * * + +

    Span Elements

    + + + +Markdown supports two style of links: *inline* and *reference*. + +In both styles, the link text is delimited by [square brackets]. + +To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an *optional* +title for the link, surrounded in quotes. For example: + + This is [an example](http://example.com/ "Title") inline link. + + [This link](http://example.net/) has no title attribute. + +Will produce: + +

    This is + an example inline link.

    + +

    This link has no + title attribute.

    + +If you're referring to a local resource on the same server, you can +use relative paths: + + See my [About](/about/) page for details. + +Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link: + + This is [an example][id] reference-style link. + +You can optionally use a space to separate the sets of brackets: + + This is [an example] [id] reference-style link. + +Then, anywhere in the document, you define your link label like this, +on a line by itself: + + [id]: http://example.com/ "Optional Title Here" + +That is: + +* Square brackets containing the link identifier (optionally + indented from the left margin using up to three spaces); +* followed by a colon; +* followed by one or more spaces (or tabs); +* followed by the URL for the link; +* optionally followed by a title attribute for the link, enclosed + in double or single quotes. + +The link URL may, optionally, be surrounded by angle brackets: + + [id]: "Optional Title Here" + +You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs: + + [id]: http://example.com/longish/path/to/resource/here + "Optional Title Here" + +Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output. + +Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: + + [link text][a] + [link text][A] + +are equivalent. + +The *implicit link name* shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write: + + [Google][] + +And then define the link: + + [Google]: http://google.com/ + +Because link names may contain spaces, this shortcut even works for +multiple words in the link text: + + Visit [Daring Fireball][] for more information. + +And then define the link: + + [Daring Fireball]: http://daringfireball.net/ + +Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes. + +Here's an example of reference links in action: + + I get 10 times more traffic from [Google] [1] than from + [Yahoo] [2] or [MSN] [3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Using the implicit link name shortcut, you could instead write: + + I get 10 times more traffic from [Google][] than from + [Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" + +Both of the above examples will produce the following HTML output: + +

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

    + +For comparison, here is the same paragraph written using +Markdown's inline link style: + + I get 10 times more traffic from [Google](http://google.com/ "Google") + than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or + [MSN](http://search.msn.com/ "MSN Search"). + +The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text. + +With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose. + + +

    Emphasis

    + +Markdown treats asterisks (`*`) and underscores (`_`) as indicators of +emphasis. Text wrapped with one `*` or `_` will be wrapped with an +HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML +`` tag. E.g., this input: + + *single asterisks* + + _single underscores_ + + **double asterisks** + + __double underscores__ + +will produce: + + single asterisks + + single underscores + + double asterisks + + double underscores + +You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span. + +Emphasis can be used in the middle of a word: + + un*fucking*believable + +But if you surround an `*` or `_` with spaces, it'll be treated as a +literal asterisk or underscore. + +To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it: + + \*this text is surrounded by literal asterisks\* + + + +

    Code

    + +To indicate a span of code, wrap it with backtick quotes (`` ` ``). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example: + + Use the `printf()` function. + +will produce: + +

    Use the printf() function.

    + +To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters: + + ``There is a literal backtick (`) here.`` + +which will produce this: + +

    There is a literal backtick (`) here.

    + +The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span: + + A single backtick in a code span: `` ` `` + + A backtick-delimited string in a code span: `` `foo` `` + +will produce: + +

    A single backtick in a code span: `

    + +

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

    + +With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this: + + Please don't use any `` tags. + +into: + +

    Please don't use any <blink> tags.

    + +You can write this: + + `—` is the decimal-encoded equivalent of `—`. + +to produce: + +

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

    + + + +

    Images

    + +Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format. + +Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: *inline* and *reference*. + +Inline image syntax looks like this: + + ![Alt text](/path/to/img.jpg) + + ![Alt text](/path/to/img.jpg "Optional title") + +That is: + +* An exclamation mark: `!`; +* followed by a set of square brackets, containing the `alt` + attribute text for the image; +* followed by a set of parentheses, containing the URL or path to + the image, and an optional `title` attribute enclosed in double + or single quotes. + +Reference-style image syntax looks like this: + + ![Alt text][id] + +Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references: + + [id]: url/to/image "Optional title attribute" + +As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML `` tags. + + +* * * + + +

    Miscellaneous

    + + + +Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: + + + +Markdown will turn this into: + + http://example.com/ + +Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this: + + + +into something like this: + + address@exa + mple.com + +which will render in a browser as a clickable link to "address@example.com". + +(This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.) + + + +

    Backslash Escapes

    + +Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML `` tag), you can backslashes +before the asterisks, like this: + + \*literal asterisks\* + +Markdown provides backslash escapes for the following characters: + + \ backslash + ` backtick + * asterisk + _ underscore + {} curly braces + [] square brackets + () parentheses + # hash mark + + plus sign + - minus sign (hyphen) + . dot + ! exclamation mark + diff --git a/app/bower_components/marked/test/original/nested_blockquotes.html b/app/bower_components/marked/test/original/nested_blockquotes.html new file mode 100644 index 000000000..d8ec7f8e0 --- /dev/null +++ b/app/bower_components/marked/test/original/nested_blockquotes.html @@ -0,0 +1,9 @@ +
    +

    foo

    + +
    +

    bar

    +
    + +

    foo

    +
    diff --git a/app/bower_components/marked/test/original/nested_blockquotes.text b/app/bower_components/marked/test/original/nested_blockquotes.text new file mode 100644 index 000000000..ed3c624ff --- /dev/null +++ b/app/bower_components/marked/test/original/nested_blockquotes.text @@ -0,0 +1,5 @@ +> foo +> +> > bar +> +> foo diff --git a/app/bower_components/marked/test/original/ordered_and_unordered_lists.html b/app/bower_components/marked/test/original/ordered_and_unordered_lists.html new file mode 100644 index 000000000..ba71eab39 --- /dev/null +++ b/app/bower_components/marked/test/original/ordered_and_unordered_lists.html @@ -0,0 +1,148 @@ +

    Unordered

    + +

    Asterisks tight:

    + +
      +
    • asterisk 1
    • +
    • asterisk 2
    • +
    • asterisk 3
    • +
    + +

    Asterisks loose:

    + +
      +
    • asterisk 1

    • +
    • asterisk 2

    • +
    • asterisk 3

    • +
    + +
    + +

    Pluses tight:

    + +
      +
    • Plus 1
    • +
    • Plus 2
    • +
    • Plus 3
    • +
    + +

    Pluses loose:

    + +
      +
    • Plus 1

    • +
    • Plus 2

    • +
    • Plus 3

    • +
    + +
    + +

    Minuses tight:

    + +
      +
    • Minus 1
    • +
    • Minus 2
    • +
    • Minus 3
    • +
    + +

    Minuses loose:

    + +
      +
    • Minus 1

    • +
    • Minus 2

    • +
    • Minus 3

    • +
    + +

    Ordered

    + +

    Tight:

    + +
      +
    1. First
    2. +
    3. Second
    4. +
    5. Third
    6. +
    + +

    and:

    + +
      +
    1. One
    2. +
    3. Two
    4. +
    5. Three
    6. +
    + +

    Loose using tabs:

    + +
      +
    1. First

    2. +
    3. Second

    4. +
    5. Third

    6. +
    + +

    and using spaces:

    + +
      +
    1. One

    2. +
    3. Two

    4. +
    5. Three

    6. +
    + +

    Multiple paragraphs:

    + +
      +
    1. Item 1, graf one.

      + +

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

    2. +
    3. Item 2.

    4. +
    5. Item 3.

    6. +
    + +

    Nested

    + +
      +
    • Tab +
        +
      • Tab +
          +
        • Tab
        • +
      • +
    • +
    + +

    Here's another:

    + +
      +
    1. First
    2. +
    3. Second: +
        +
      • Fee
      • +
      • Fie
      • +
      • Foe
      • +
    4. +
    5. Third
    6. +
    + +

    Same thing but with paragraphs:

    + +
      +
    1. First

    2. +
    3. Second:

      + +
        +
      • Fee
      • +
      • Fie
      • +
      • Foe
      • +
    4. +
    5. Third

    6. +
    + + +

    This was an error in Markdown 1.0.1:

    + +
      +
    • this

      + +
      • sub
      + +

      that

    • +
    diff --git a/app/bower_components/marked/test/original/ordered_and_unordered_lists.text b/app/bower_components/marked/test/original/ordered_and_unordered_lists.text new file mode 100644 index 000000000..7f3b49777 --- /dev/null +++ b/app/bower_components/marked/test/original/ordered_and_unordered_lists.text @@ -0,0 +1,131 @@ +## Unordered + +Asterisks tight: + +* asterisk 1 +* asterisk 2 +* asterisk 3 + + +Asterisks loose: + +* asterisk 1 + +* asterisk 2 + +* asterisk 3 + +* * * + +Pluses tight: + ++ Plus 1 ++ Plus 2 ++ Plus 3 + + +Pluses loose: + ++ Plus 1 + ++ Plus 2 + ++ Plus 3 + +* * * + + +Minuses tight: + +- Minus 1 +- Minus 2 +- Minus 3 + + +Minuses loose: + +- Minus 1 + +- Minus 2 + +- Minus 3 + + +## Ordered + +Tight: + +1. First +2. Second +3. Third + +and: + +1. One +2. Two +3. Three + + +Loose using tabs: + +1. First + +2. Second + +3. Third + +and using spaces: + +1. One + +2. Two + +3. Three + +Multiple paragraphs: + +1. Item 1, graf one. + + Item 2. graf two. The quick brown fox jumped over the lazy dog's + back. + +2. Item 2. + +3. Item 3. + + + +## Nested + +* Tab + * Tab + * Tab + +Here's another: + +1. First +2. Second: + * Fee + * Fie + * Foe +3. Third + +Same thing but with paragraphs: + +1. First + +2. Second: + * Fee + * Fie + * Foe + +3. Third + + +This was an error in Markdown 1.0.1: + +* this + + * sub + + that diff --git a/app/bower_components/marked/test/original/strong_and_em_together.html b/app/bower_components/marked/test/original/strong_and_em_together.html new file mode 100644 index 000000000..71ec78c70 --- /dev/null +++ b/app/bower_components/marked/test/original/strong_and_em_together.html @@ -0,0 +1,7 @@ +

    This is strong and em.

    + +

    So is this word.

    + +

    This is strong and em.

    + +

    So is this word.

    diff --git a/app/bower_components/marked/test/original/strong_and_em_together.text b/app/bower_components/marked/test/original/strong_and_em_together.text new file mode 100644 index 000000000..95ee690db --- /dev/null +++ b/app/bower_components/marked/test/original/strong_and_em_together.text @@ -0,0 +1,7 @@ +***This is strong and em.*** + +So is ***this*** word. + +___This is strong and em.___ + +So is ___this___ word. diff --git a/app/bower_components/marked/test/original/tabs.html b/app/bower_components/marked/test/original/tabs.html new file mode 100644 index 000000000..3301ba803 --- /dev/null +++ b/app/bower_components/marked/test/original/tabs.html @@ -0,0 +1,25 @@ +
      +
    • this is a list item +indented with tabs

    • +
    • this is a list item +indented with spaces

    • +
    + +

    Code:

    + +
    this code block is indented by one tab
    +
    + +

    And:

    + +
        this code block is indented by two tabs
    +
    + +

    And:

    + +
    +   this is an example list item
    +    indented with tabs
    +
    ++   this is an example list item
    +    indented with spaces
    +
    diff --git a/app/bower_components/marked/test/original/tabs.text b/app/bower_components/marked/test/original/tabs.text new file mode 100644 index 000000000..589d1136e --- /dev/null +++ b/app/bower_components/marked/test/original/tabs.text @@ -0,0 +1,21 @@ ++ this is a list item + indented with tabs + ++ this is a list item + indented with spaces + +Code: + + this code block is indented by one tab + +And: + + this code block is indented by two tabs + +And: + + + this is an example list item + indented with tabs + + + this is an example list item + indented with spaces diff --git a/app/bower_components/marked/test/original/tidyness.html b/app/bower_components/marked/test/original/tidyness.html new file mode 100644 index 000000000..f2a8ce70f --- /dev/null +++ b/app/bower_components/marked/test/original/tidyness.html @@ -0,0 +1,8 @@ +
    +

    A list within a blockquote:

    +
      +
    • asterisk 1
    • +
    • asterisk 2
    • +
    • asterisk 3
    • +
    +
    diff --git a/app/bower_components/marked/test/original/tidyness.text b/app/bower_components/marked/test/original/tidyness.text new file mode 100644 index 000000000..5f18b8da2 --- /dev/null +++ b/app/bower_components/marked/test/original/tidyness.text @@ -0,0 +1,5 @@ +> A list within a blockquote: +> +> * asterisk 1 +> * asterisk 2 +> * asterisk 3 diff --git a/app/bower_components/marked/test/tests/amps_and_angles_encoding.html b/app/bower_components/marked/test/tests/amps_and_angles_encoding.html new file mode 100644 index 000000000..93c1db550 --- /dev/null +++ b/app/bower_components/marked/test/tests/amps_and_angles_encoding.html @@ -0,0 +1,17 @@ +

    AT&T has an ampersand in their name.

    + +

    AT&T is another way to write it.

    + +

    This & that.

    + +

    4 < 5.

    + +

    6 > 5.

    + +

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

    + +

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

    + +

    Here's an inline link.

    + +

    Here's an inline link.

    diff --git a/app/bower_components/marked/test/tests/amps_and_angles_encoding.text b/app/bower_components/marked/test/tests/amps_and_angles_encoding.text new file mode 100644 index 000000000..89ec3ae1d --- /dev/null +++ b/app/bower_components/marked/test/tests/amps_and_angles_encoding.text @@ -0,0 +1,21 @@ +AT&T has an ampersand in their name. + +AT&T is another way to write it. + +This & that. + +4 < 5. + +6 > 5. + +Here's a [link] [1] with an ampersand in the URL. + +Here's a link with an amersand in the link text: [AT&T] [2]. + +Here's an inline [link](/script?foo=1&bar=2). + +Here's an inline [link](). + + +[1]: http://example.com/?foo=1&bar=2 +[2]: http://att.com/ "AT&T" diff --git a/app/bower_components/marked/test/tests/auto_links.html b/app/bower_components/marked/test/tests/auto_links.html new file mode 100644 index 000000000..f8df9852c --- /dev/null +++ b/app/bower_components/marked/test/tests/auto_links.html @@ -0,0 +1,18 @@ +

    Link: http://example.com/.

    + +

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

    + + + +
    +

    Blockquoted: http://example.com/

    +
    + +

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

    + +
    or here: <http://example.com/>
    +
    diff --git a/app/bower_components/marked/test/tests/auto_links.text b/app/bower_components/marked/test/tests/auto_links.text new file mode 100644 index 000000000..f85767b48 --- /dev/null +++ b/app/bower_components/marked/test/tests/auto_links.text @@ -0,0 +1,13 @@ +Link: . + +With an ampersand: + +* In a list? +* +* It should. + +> Blockquoted: + +Auto-links should not occur here: `` + + or here: diff --git a/app/bower_components/marked/test/tests/autolink_lines.html b/app/bower_components/marked/test/tests/autolink_lines.html new file mode 100644 index 000000000..aa2bed4d3 --- /dev/null +++ b/app/bower_components/marked/test/tests/autolink_lines.html @@ -0,0 +1,3 @@ +

    hello world +http://example.com +

    diff --git a/app/bower_components/marked/test/tests/autolink_lines.text b/app/bower_components/marked/test/tests/autolink_lines.text new file mode 100644 index 000000000..c9b61a2ca --- /dev/null +++ b/app/bower_components/marked/test/tests/autolink_lines.text @@ -0,0 +1,2 @@ +hello world + diff --git a/app/bower_components/marked/test/tests/backslash_escapes.html b/app/bower_components/marked/test/tests/backslash_escapes.html new file mode 100644 index 000000000..c7f0e5ee2 --- /dev/null +++ b/app/bower_components/marked/test/tests/backslash_escapes.html @@ -0,0 +1,118 @@ +

    These should all get escaped:

    + +

    Backslash: \

    + +

    Backtick: `

    + +

    Asterisk: *

    + +

    Underscore: _

    + +

    Left brace: {

    + +

    Right brace: }

    + +

    Left bracket: [

    + +

    Right bracket: ]

    + +

    Left paren: (

    + +

    Right paren: )

    + +

    Greater-than: >

    + +

    Hash: #

    + +

    Period: .

    + +

    Bang: !

    + +

    Plus: +

    + +

    Minus: -

    + +

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

    + +
    Backslash: \\
    +
    +Backtick: \`
    +
    +Asterisk: \*
    +
    +Underscore: \_
    +
    +Left brace: \{
    +
    +Right brace: \}
    +
    +Left bracket: \[
    +
    +Right bracket: \]
    +
    +Left paren: \(
    +
    +Right paren: \)
    +
    +Greater-than: \>
    +
    +Hash: \#
    +
    +Period: \.
    +
    +Bang: \!
    +
    +Plus: \+
    +
    +Minus: \-
    +
    + +

    Nor should these, which occur in code spans:

    + +

    Backslash: \\

    + +

    Backtick: \`

    + +

    Asterisk: \*

    + +

    Underscore: \_

    + +

    Left brace: \{

    + +

    Right brace: \}

    + +

    Left bracket: \[

    + +

    Right bracket: \]

    + +

    Left paren: \(

    + +

    Right paren: \)

    + +

    Greater-than: \>

    + +

    Hash: \#

    + +

    Period: \.

    + +

    Bang: \!

    + +

    Plus: \+

    + +

    Minus: \-

    + + +

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

    + +

    *asterisks*

    + +

    _underscores_

    + +

    `backticks`

    + +

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

    + +

    This is a tag with unescaped backticks bar.

    + +

    This is a tag with backslashes bar.

    diff --git a/app/bower_components/marked/test/tests/backslash_escapes.text b/app/bower_components/marked/test/tests/backslash_escapes.text new file mode 100644 index 000000000..5b014cb33 --- /dev/null +++ b/app/bower_components/marked/test/tests/backslash_escapes.text @@ -0,0 +1,120 @@ +These should all get escaped: + +Backslash: \\ + +Backtick: \` + +Asterisk: \* + +Underscore: \_ + +Left brace: \{ + +Right brace: \} + +Left bracket: \[ + +Right bracket: \] + +Left paren: \( + +Right paren: \) + +Greater-than: \> + +Hash: \# + +Period: \. + +Bang: \! + +Plus: \+ + +Minus: \- + + + +These should not, because they occur within a code block: + + Backslash: \\ + + Backtick: \` + + Asterisk: \* + + Underscore: \_ + + Left brace: \{ + + Right brace: \} + + Left bracket: \[ + + Right bracket: \] + + Left paren: \( + + Right paren: \) + + Greater-than: \> + + Hash: \# + + Period: \. + + Bang: \! + + Plus: \+ + + Minus: \- + + +Nor should these, which occur in code spans: + +Backslash: `\\` + +Backtick: `` \` `` + +Asterisk: `\*` + +Underscore: `\_` + +Left brace: `\{` + +Right brace: `\}` + +Left bracket: `\[` + +Right bracket: `\]` + +Left paren: `\(` + +Right paren: `\)` + +Greater-than: `\>` + +Hash: `\#` + +Period: `\.` + +Bang: `\!` + +Plus: `\+` + +Minus: `\-` + + +These should get escaped, even though they're matching pairs for +other Markdown constructs: + +\*asterisks\* + +\_underscores\_ + +\`backticks\` + +This is a code span with a literal backslash-backtick sequence: `` \` `` + +This is a tag with unescaped backticks bar. + +This is a tag with backslashes bar. diff --git a/app/bower_components/marked/test/tests/blockquote_list_item.html b/app/bower_components/marked/test/tests/blockquote_list_item.html new file mode 100644 index 000000000..83cf0bddf --- /dev/null +++ b/app/bower_components/marked/test/tests/blockquote_list_item.html @@ -0,0 +1,3 @@ +

    This fails in markdown.pl and upskirt:

    + +
    • hello

      world

    diff --git a/app/bower_components/marked/test/tests/blockquote_list_item.text b/app/bower_components/marked/test/tests/blockquote_list_item.text new file mode 100644 index 000000000..19e938294 --- /dev/null +++ b/app/bower_components/marked/test/tests/blockquote_list_item.text @@ -0,0 +1,4 @@ +This fails in markdown.pl and upskirt: + +* hello + > world diff --git a/app/bower_components/marked/test/tests/blockquotes_with_code_blocks.html b/app/bower_components/marked/test/tests/blockquotes_with_code_blocks.html new file mode 100644 index 000000000..38ee5f097 --- /dev/null +++ b/app/bower_components/marked/test/tests/blockquotes_with_code_blocks.html @@ -0,0 +1,15 @@ +
    +

    Example:

    + +
    sub status {
    +    print "working";
    +}
    +
    + +

    Or:

    + +
    sub status {
    +    return "working";
    +}
    +
    +
    diff --git a/app/bower_components/marked/test/tests/blockquotes_with_code_blocks.text b/app/bower_components/marked/test/tests/blockquotes_with_code_blocks.text new file mode 100644 index 000000000..c31d17104 --- /dev/null +++ b/app/bower_components/marked/test/tests/blockquotes_with_code_blocks.text @@ -0,0 +1,11 @@ +> Example: +> +> sub status { +> print "working"; +> } +> +> Or: +> +> sub status { +> return "working"; +> } diff --git a/app/bower_components/marked/test/tests/case_insensitive_refs.html b/app/bower_components/marked/test/tests/case_insensitive_refs.html new file mode 100644 index 000000000..c54388ea5 --- /dev/null +++ b/app/bower_components/marked/test/tests/case_insensitive_refs.html @@ -0,0 +1 @@ +

    hi

    diff --git a/app/bower_components/marked/test/tests/case_insensitive_refs.text b/app/bower_components/marked/test/tests/case_insensitive_refs.text new file mode 100644 index 000000000..598915a8a --- /dev/null +++ b/app/bower_components/marked/test/tests/case_insensitive_refs.text @@ -0,0 +1,3 @@ +[hi] + +[HI]: /url diff --git a/app/bower_components/marked/test/tests/code_blocks.html b/app/bower_components/marked/test/tests/code_blocks.html new file mode 100644 index 000000000..32703f5cb --- /dev/null +++ b/app/bower_components/marked/test/tests/code_blocks.html @@ -0,0 +1,18 @@ +
    code block on the first line
    +
    + +

    Regular text.

    + +
    code block indented by spaces
    +
    + +

    Regular text.

    + +
    the lines in this block  
    +all contain trailing spaces  
    +
    + +

    Regular Text.

    + +
    code block on the last line
    +
    diff --git a/app/bower_components/marked/test/tests/code_blocks.text b/app/bower_components/marked/test/tests/code_blocks.text new file mode 100644 index 000000000..01f9a733b --- /dev/null +++ b/app/bower_components/marked/test/tests/code_blocks.text @@ -0,0 +1,14 @@ + code block on the first line + +Regular text. + + code block indented by spaces + +Regular text. + + the lines in this block + all contain trailing spaces + +Regular Text. + + code block on the last line diff --git a/app/bower_components/marked/test/tests/code_spans.html b/app/bower_components/marked/test/tests/code_spans.html new file mode 100644 index 000000000..860e97c9f --- /dev/null +++ b/app/bower_components/marked/test/tests/code_spans.html @@ -0,0 +1,6 @@ +

    <test a=" content of attribute ">

    + +

    Fix for backticks within HTML tag: like this

    + +

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

    + diff --git a/app/bower_components/marked/test/tests/code_spans.text b/app/bower_components/marked/test/tests/code_spans.text new file mode 100644 index 000000000..750a1973d --- /dev/null +++ b/app/bower_components/marked/test/tests/code_spans.text @@ -0,0 +1,6 @@ +`` + +Fix for backticks within HTML tag: like this + +Here's how you put `` `backticks` `` in a code span. + diff --git a/app/bower_components/marked/test/tests/def_blocks.html b/app/bower_components/marked/test/tests/def_blocks.html new file mode 100644 index 000000000..14edc97a4 --- /dev/null +++ b/app/bower_components/marked/test/tests/def_blocks.html @@ -0,0 +1,28 @@ +
    +

    hello +[1]: hello

    +
    + +
    + +
    +

    hello

    +
    + + +
      +
    • hello
    • +
    • [3]: hello
    • +
    + + +
      +
    • hello
    • +
    + + +
    +

    foo +bar +bar

    +
    diff --git a/app/bower_components/marked/test/tests/def_blocks.text b/app/bower_components/marked/test/tests/def_blocks.text new file mode 100644 index 000000000..4d1629298 --- /dev/null +++ b/app/bower_components/marked/test/tests/def_blocks.text @@ -0,0 +1,21 @@ +> hello +> [1]: hello + +* * * + +> hello +[2]: hello + + +* hello +* [3]: hello + + +* hello +[4]: hello + + +> foo +> bar +[1]: foo +> bar diff --git a/app/bower_components/marked/test/tests/double_link.html b/app/bower_components/marked/test/tests/double_link.html new file mode 100644 index 000000000..ff68395a3 --- /dev/null +++ b/app/bower_components/marked/test/tests/double_link.html @@ -0,0 +1,5 @@ +

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

    + +

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

    + +

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

    diff --git a/app/bower_components/marked/test/tests/double_link.text b/app/bower_components/marked/test/tests/double_link.text new file mode 100644 index 000000000..50216736c --- /dev/null +++ b/app/bower_components/marked/test/tests/double_link.text @@ -0,0 +1,5 @@ +

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

    + +Already linked: [http://example.com/](http://example.com/). + +Already linked: **http://example.com/**. diff --git a/app/bower_components/marked/test/tests/escaped_angles.html b/app/bower_components/marked/test/tests/escaped_angles.html new file mode 100644 index 000000000..7cf47c49e --- /dev/null +++ b/app/bower_components/marked/test/tests/escaped_angles.html @@ -0,0 +1 @@ +

    >

    diff --git a/app/bower_components/marked/test/tests/escaped_angles.text b/app/bower_components/marked/test/tests/escaped_angles.text new file mode 100644 index 000000000..db7422f13 --- /dev/null +++ b/app/bower_components/marked/test/tests/escaped_angles.text @@ -0,0 +1 @@ +\> diff --git a/app/bower_components/marked/test/tests/gfm_break.breaks.html b/app/bower_components/marked/test/tests/gfm_break.breaks.html new file mode 100644 index 000000000..398ba018c --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_break.breaks.html @@ -0,0 +1 @@ +

    Look at the
    pretty line
    breaks.

    diff --git a/app/bower_components/marked/test/tests/gfm_break.breaks.text b/app/bower_components/marked/test/tests/gfm_break.breaks.text new file mode 100644 index 000000000..71097d23b --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_break.breaks.text @@ -0,0 +1,3 @@ +Look at the +pretty line +breaks. diff --git a/app/bower_components/marked/test/tests/gfm_code.html b/app/bower_components/marked/test/tests/gfm_code.html new file mode 100644 index 000000000..fe3522e23 --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_code.html @@ -0,0 +1,5 @@ +
    var a = 'hello';
    +console.log(a + ' world');
    +
    echo "hello, ${WORLD}"
    +
    Q: What do you call a tall person who sells stolen goods?
    +
    A longfence!
    diff --git a/app/bower_components/marked/test/tests/gfm_code.text b/app/bower_components/marked/test/tests/gfm_code.text new file mode 100644 index 000000000..c594387c4 --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_code.text @@ -0,0 +1,16 @@ +``` js +var a = 'hello'; +console.log(a + ' world'); +``` + +~~~bash +echo "hello, ${WORLD}" +~~~ + +```````longfence +Q: What do you call a tall person who sells stolen goods? +``````` + +~~~~~~~~~~ ManyTildes +A longfence! +~~~~~~~~~~ diff --git a/app/bower_components/marked/test/tests/gfm_code_hr_list.html b/app/bower_components/marked/test/tests/gfm_code_hr_list.html new file mode 100644 index 000000000..9fbd0fb9d --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_code_hr_list.html @@ -0,0 +1,52 @@ +

    foo

    +
      +
    1. bar:

      +
      +
        +
      • one
          +
        • two
            +
          • three
          • +
          • four
          • +
          • five
          • +
          +
        • +
        +
      • +
      +
      +
    2. +
    3. foo:

      +
       line 1
      + line 2
      +
    4. +
    5. foo:

      +
        +
      1. foo bar bar:

        +
         some code here
        +
        +
      2. +
      3. foo bar bar:

        +
         foo
        + ---
        + bar
        + ---
        + foo
        + bar
        +
      4. +
      5. foo bar bar:

        +
         ---
        + foo
        + foo
        + ---
        + bar
        +
      6. +
      7. foo bar bar:

        +
         foo
        + ---
        + bar
        +
      8. +
      9. foo

        +
      10. +
      +
    6. +
    diff --git a/app/bower_components/marked/test/tests/gfm_code_hr_list.text b/app/bower_components/marked/test/tests/gfm_code_hr_list.text new file mode 100644 index 000000000..0eba40598 --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_code_hr_list.text @@ -0,0 +1,53 @@ +## foo + +1. bar: + + > - one + - two + - three + - four + - five + +1. foo: + + ``` + line 1 + line 2 + ``` + +1. foo: + + 1. foo `bar` bar: + + ``` erb + some code here + ``` + + 2. foo `bar` bar: + + ``` erb + foo + --- + bar + --- + foo + bar + ``` + + 3. foo `bar` bar: + + ``` html + --- + foo + foo + --- + bar + ``` + + 4. foo `bar` bar: + + foo + --- + bar + + 5. foo diff --git a/app/bower_components/marked/test/tests/gfm_del.html b/app/bower_components/marked/test/tests/gfm_del.html new file mode 100644 index 000000000..95e9ec74b --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_del.html @@ -0,0 +1 @@ +

    hello hi world

    diff --git a/app/bower_components/marked/test/tests/gfm_del.text b/app/bower_components/marked/test/tests/gfm_del.text new file mode 100644 index 000000000..d29ca77d4 --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_del.text @@ -0,0 +1 @@ +hello ~~hi~~ world diff --git a/app/bower_components/marked/test/tests/gfm_em.html b/app/bower_components/marked/test/tests/gfm_em.html new file mode 100644 index 000000000..8fac3466a --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_em.html @@ -0,0 +1 @@ +

    These words should_not_be_emphasized.

    diff --git a/app/bower_components/marked/test/tests/gfm_em.text b/app/bower_components/marked/test/tests/gfm_em.text new file mode 100644 index 000000000..6319874b9 --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_em.text @@ -0,0 +1 @@ +These words should_not_be_emphasized. diff --git a/app/bower_components/marked/test/tests/gfm_links.html b/app/bower_components/marked/test/tests/gfm_links.html new file mode 100644 index 000000000..4f62ae1de --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_links.html @@ -0,0 +1,2 @@ +

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

    diff --git a/app/bower_components/marked/test/tests/gfm_links.text b/app/bower_components/marked/test/tests/gfm_links.text new file mode 100644 index 000000000..c1336661a --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_links.text @@ -0,0 +1 @@ +This should be a link: http://example.com/hello-world. diff --git a/app/bower_components/marked/test/tests/gfm_tables.html b/app/bower_components/marked/test/tests/gfm_tables.html new file mode 100644 index 000000000..70bec827e --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_tables.html @@ -0,0 +1,37 @@ + + + + + + + + +
    Heading 1Heading 2
    Cell 1Cell 2
    Cell 3Cell 4
    + + + + + + + + +
    Header 1Header 2Header 3Header 4
    Cell 1Cell 2Cell 3Cell 4
    Cell 5Cell 6Cell 7Cell 8
    +
    Test code
    + + + + + + + + +
    Header 1Header 2
    Cell 1Cell 2
    Cell 3Cell 4
    + + + + + + + + +
    Header 1Header 2Header 3Header 4
    Cell 1Cell 2Cell 3Cell 4
    Cell 5Cell 6Cell 7Cell 8
    diff --git a/app/bower_components/marked/test/tests/gfm_tables.text b/app/bower_components/marked/test/tests/gfm_tables.text new file mode 100644 index 000000000..5fd6321c1 --- /dev/null +++ b/app/bower_components/marked/test/tests/gfm_tables.text @@ -0,0 +1,21 @@ +| Heading 1 | Heading 2 +| --------- | --------- +| Cell 1 | Cell 2 +| Cell 3 | Cell 4 + +| Header 1 | Header 2 | Header 3 | Header 4 | +| :------: | -------: | :------- | -------- | +| Cell 1 | Cell 2 | Cell 3 | Cell 4 | +| Cell 5 | Cell 6 | Cell 7 | Cell 8 | + + Test code + +Header 1 | Header 2 +-------- | -------- +Cell 1 | Cell 2 +Cell 3 | Cell 4 + +Header 1|Header 2|Header 3|Header 4 +:-------|:------:|-------:|-------- +Cell 1 |Cell 2 |Cell 3 |Cell 4 +*Cell 5*|Cell 6 |Cell 7 |Cell 8 diff --git a/app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html b/app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html new file mode 100644 index 000000000..53662fc1b --- /dev/null +++ b/app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html @@ -0,0 +1,8 @@ +

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

    + +

    Here's one with a bullet. +* criminey.

    diff --git a/app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text b/app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text new file mode 100644 index 000000000..f8a5b27bf --- /dev/null +++ b/app/bower_components/marked/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text @@ -0,0 +1,8 @@ +In Markdown 1.0.0 and earlier. Version +8. This line turns into a list item. +Because a hard-wrapped line in the +middle of a paragraph looked like a +list item. + +Here's one with a bullet. +* criminey. diff --git a/app/bower_components/marked/test/tests/horizontal_rules.html b/app/bower_components/marked/test/tests/horizontal_rules.html new file mode 100644 index 000000000..e60d4ba25 --- /dev/null +++ b/app/bower_components/marked/test/tests/horizontal_rules.html @@ -0,0 +1,71 @@ +

    Dashes:

    + +
    + +
    + +
    + +
    + +
    ---
    +
    + +
    + +
    + +
    + +
    + +
    - - -
    +
    + +

    Asterisks:

    + +
    + +
    + +
    + +
    + +
    ***
    +
    + +
    + +
    + +
    + +
    + +
    * * *
    +
    + +

    Underscores:

    + +
    + +
    + +
    + +
    + +
    ___
    +
    + +
    + +
    + +
    + +
    + +
    _ _ _
    +
    diff --git a/app/bower_components/marked/test/tests/horizontal_rules.text b/app/bower_components/marked/test/tests/horizontal_rules.text new file mode 100644 index 000000000..1594bda27 --- /dev/null +++ b/app/bower_components/marked/test/tests/horizontal_rules.text @@ -0,0 +1,67 @@ +Dashes: + +--- + + --- + + --- + + --- + + --- + +- - - + + - - - + + - - - + + - - - + + - - - + + +Asterisks: + +*** + + *** + + *** + + *** + + *** + +* * * + + * * * + + * * * + + * * * + + * * * + + +Underscores: + +___ + + ___ + + ___ + + ___ + + ___ + +_ _ _ + + _ _ _ + + _ _ _ + + _ _ _ + + _ _ _ diff --git a/app/bower_components/marked/test/tests/hr_list_break.html b/app/bower_components/marked/test/tests/hr_list_break.html new file mode 100644 index 000000000..bd3ad1f7c --- /dev/null +++ b/app/bower_components/marked/test/tests/hr_list_break.html @@ -0,0 +1,10 @@ +
      +
    • hello +world
    • +
    • how +are
    • +
    + +
    + +

    you today?

    diff --git a/app/bower_components/marked/test/tests/hr_list_break.text b/app/bower_components/marked/test/tests/hr_list_break.text new file mode 100644 index 000000000..036fe4794 --- /dev/null +++ b/app/bower_components/marked/test/tests/hr_list_break.text @@ -0,0 +1,6 @@ +* hello +world +* how +are +* * * +you today? diff --git a/app/bower_components/marked/test/tests/inline_html_advanced.html b/app/bower_components/marked/test/tests/inline_html_advanced.html new file mode 100644 index 000000000..3af9cafb1 --- /dev/null +++ b/app/bower_components/marked/test/tests/inline_html_advanced.html @@ -0,0 +1,15 @@ +

    Simple block on one line:

    + +
    foo
    + +

    And nested without indentation:

    + +
    +
    +
    +foo +
    +
    +
    +
    bar
    +
    diff --git a/app/bower_components/marked/test/tests/inline_html_advanced.text b/app/bower_components/marked/test/tests/inline_html_advanced.text new file mode 100644 index 000000000..86b7206d2 --- /dev/null +++ b/app/bower_components/marked/test/tests/inline_html_advanced.text @@ -0,0 +1,15 @@ +Simple block on one line: + +
    foo
    + +And nested without indentation: + +
    +
    +
    +foo +
    +
    +
    +
    bar
    +
    diff --git a/app/bower_components/marked/test/tests/inline_html_comments.html b/app/bower_components/marked/test/tests/inline_html_comments.html new file mode 100644 index 000000000..3f167a161 --- /dev/null +++ b/app/bower_components/marked/test/tests/inline_html_comments.html @@ -0,0 +1,13 @@ +

    Paragraph one.

    + + + + + +

    Paragraph two.

    + + + +

    The end.

    diff --git a/app/bower_components/marked/test/tests/inline_html_comments.text b/app/bower_components/marked/test/tests/inline_html_comments.text new file mode 100644 index 000000000..41d830d03 --- /dev/null +++ b/app/bower_components/marked/test/tests/inline_html_comments.text @@ -0,0 +1,13 @@ +Paragraph one. + + + + + +Paragraph two. + + + +The end. diff --git a/app/bower_components/marked/test/tests/inline_html_simple.html b/app/bower_components/marked/test/tests/inline_html_simple.html new file mode 100644 index 000000000..35c827ddb --- /dev/null +++ b/app/bower_components/marked/test/tests/inline_html_simple.html @@ -0,0 +1,72 @@ +

    Here's a simple block:

    + +
    + foo +
    + +

    This should be a code block, though:

    + +
    <div>
    +    foo
    +</div>
    +
    + +

    As should this:

    + +
    <div>foo</div>
    +
    + +

    Now, nested:

    + +
    +
    +
    + foo +
    +
    +
    + +

    This should just be an HTML comment:

    + + + +

    Multiline:

    + + + +

    Code block:

    + +
    <!-- Comment -->
    +
    + +

    Just plain comment, with trailing spaces on the line:

    + + + +

    Code:

    + +
    <hr>
    +
    + +

    Hr's:

    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    diff --git a/app/bower_components/marked/test/tests/inline_html_simple.text b/app/bower_components/marked/test/tests/inline_html_simple.text new file mode 100644 index 000000000..df49d7bf9 --- /dev/null +++ b/app/bower_components/marked/test/tests/inline_html_simple.text @@ -0,0 +1,69 @@ +Here's a simple block: + +
    + foo +
    + +This should be a code block, though: + +
    + foo +
    + +As should this: + +
    foo
    + +Now, nested: + +
    +
    +
    + foo +
    +
    +
    + +This should just be an HTML comment: + + + +Multiline: + + + +Code block: + + + +Just plain comment, with trailing spaces on the line: + + + +Code: + +
    + +Hr's: + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + diff --git a/app/bower_components/marked/test/tests/lazy_blockquotes.html b/app/bower_components/marked/test/tests/lazy_blockquotes.html new file mode 100644 index 000000000..a701d42af --- /dev/null +++ b/app/bower_components/marked/test/tests/lazy_blockquotes.html @@ -0,0 +1,4 @@ +
    +

    hi there +bud

    +
    diff --git a/app/bower_components/marked/test/tests/lazy_blockquotes.text b/app/bower_components/marked/test/tests/lazy_blockquotes.text new file mode 100644 index 000000000..c0e0b1549 --- /dev/null +++ b/app/bower_components/marked/test/tests/lazy_blockquotes.text @@ -0,0 +1,2 @@ +> hi there +bud diff --git a/app/bower_components/marked/test/tests/links_inline_style.html b/app/bower_components/marked/test/tests/links_inline_style.html new file mode 100644 index 000000000..09df236ed --- /dev/null +++ b/app/bower_components/marked/test/tests/links_inline_style.html @@ -0,0 +1,15 @@ +

    Just a URL.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    URL and title.

    + +

    Empty.

    diff --git a/app/bower_components/marked/test/tests/links_inline_style.text b/app/bower_components/marked/test/tests/links_inline_style.text new file mode 100644 index 000000000..8c8eb4902 --- /dev/null +++ b/app/bower_components/marked/test/tests/links_inline_style.text @@ -0,0 +1,15 @@ +Just a [URL](/url/). + +[URL and title](/url/ "title"). + +[URL and title](/url/ "title preceded by two spaces"). + +[URL and title](/url/ "title preceded by a tab"). + +[URL and title](/url/ "title has spaces afterward" ). + +[URL and title]( /url/has space ). + +[URL and title]( /url/has space/ "url has space and title"). + +[Empty](). diff --git a/app/bower_components/marked/test/tests/links_reference_style.html b/app/bower_components/marked/test/tests/links_reference_style.html new file mode 100644 index 000000000..51f41871e --- /dev/null +++ b/app/bower_components/marked/test/tests/links_reference_style.html @@ -0,0 +1,52 @@ +

    Foo bar.

    + +

    Foo bar.

    + +

    Foo bar.

    + +

    With embedded [brackets].

    + +

    Indented once.

    + +

    Indented twice.

    + +

    Indented thrice.

    + +

    Indented [four][] times.

    + +
    [four]: /url
    +
    + +
    + +

    this should work

    + +

    So should this.

    + +

    And this.

    + +

    And this.

    + +

    And this.

    + +

    But not [that] [].

    + +

    Nor [that][].

    + +

    Nor [that].

    + +

    [Something in brackets like this should work]

    + +

    [Same with this.]

    + +

    In this case, this points to something else.

    + +

    Backslashing should suppress [this] and [this].

    + +
    + +

    Here's one where the link +breaks across lines.

    + +

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

    diff --git a/app/bower_components/marked/test/tests/links_reference_style.text b/app/bower_components/marked/test/tests/links_reference_style.text new file mode 100644 index 000000000..341ec88e3 --- /dev/null +++ b/app/bower_components/marked/test/tests/links_reference_style.text @@ -0,0 +1,71 @@ +Foo [bar] [1]. + +Foo [bar][1]. + +Foo [bar] +[1]. + +[1]: /url/ "Title" + + +With [embedded [brackets]] [b]. + + +Indented [once][]. + +Indented [twice][]. + +Indented [thrice][]. + +Indented [four][] times. + + [once]: /url + + [twice]: /url + + [thrice]: /url + + [four]: /url + + +[b]: /url/ + +* * * + +[this] [this] should work + +So should [this][this]. + +And [this] []. + +And [this][]. + +And [this]. + +But not [that] []. + +Nor [that][]. + +Nor [that]. + +[Something in brackets like [this][] should work] + +[Same with [this].] + +In this case, [this](/somethingelse/) points to something else. + +Backslashing should suppress \[this] and [this\]. + +[this]: foo + + +* * * + +Here's one where the [link +breaks] across lines. + +Here's another where the [link +breaks] across lines, but with a line-ending space. + + +[link breaks]: /url/ diff --git a/app/bower_components/marked/test/tests/links_shortcut_references.html b/app/bower_components/marked/test/tests/links_shortcut_references.html new file mode 100644 index 000000000..bf81e939f --- /dev/null +++ b/app/bower_components/marked/test/tests/links_shortcut_references.html @@ -0,0 +1,9 @@ +

    This is the simple case.

    + +

    This one has a line +break.

    + +

    This one has a line +break with a line-ending space.

    + +

    this and the other

    diff --git a/app/bower_components/marked/test/tests/links_shortcut_references.text b/app/bower_components/marked/test/tests/links_shortcut_references.text new file mode 100644 index 000000000..8c44c98fe --- /dev/null +++ b/app/bower_components/marked/test/tests/links_shortcut_references.text @@ -0,0 +1,20 @@ +This is the [simple case]. + +[simple case]: /simple + + + +This one has a [line +break]. + +This one has a [line +break] with a line-ending space. + +[line break]: /foo + + +[this] [that] and the [other] + +[this]: /this +[that]: /that +[other]: /other diff --git a/app/bower_components/marked/test/tests/list_item_text.html b/app/bower_components/marked/test/tests/list_item_text.html new file mode 100644 index 000000000..142df366e --- /dev/null +++ b/app/bower_components/marked/test/tests/list_item_text.html @@ -0,0 +1 @@ +
    • item1

      • item2

      text

    diff --git a/app/bower_components/marked/test/tests/list_item_text.text b/app/bower_components/marked/test/tests/list_item_text.text new file mode 100644 index 000000000..a8f81b140 --- /dev/null +++ b/app/bower_components/marked/test/tests/list_item_text.text @@ -0,0 +1,5 @@ + * item1 + + * item2 + + text diff --git a/app/bower_components/marked/test/tests/literal_quotes_in_titles.html b/app/bower_components/marked/test/tests/literal_quotes_in_titles.html new file mode 100644 index 000000000..611c1ac61 --- /dev/null +++ b/app/bower_components/marked/test/tests/literal_quotes_in_titles.html @@ -0,0 +1,3 @@ +

    Foo bar.

    + +

    Foo bar.

    diff --git a/app/bower_components/marked/test/tests/literal_quotes_in_titles.text b/app/bower_components/marked/test/tests/literal_quotes_in_titles.text new file mode 100644 index 000000000..29d0e4235 --- /dev/null +++ b/app/bower_components/marked/test/tests/literal_quotes_in_titles.text @@ -0,0 +1,7 @@ +Foo [bar][]. + +Foo [bar](/url/ "Title with "quotes" inside"). + + + [bar]: /url/ "Title with "quotes" inside" + diff --git a/app/bower_components/marked/test/tests/loose_lists.html b/app/bower_components/marked/test/tests/loose_lists.html new file mode 100644 index 000000000..c1bd82a26 --- /dev/null +++ b/app/bower_components/marked/test/tests/loose_lists.html @@ -0,0 +1,62 @@ +
      +
    • hello +world

      + +

      how +are

    • +
    • you
    • +
    + + + +

    better behavior:

    + +
    • hello

      • world +how

        are +you

      • today

    • hi
    + + + +
      +
    • hello

    • +
    • world

    • +
    • hi
    • +
    + + + +
      +
    • hello
    • +
    • world

    • +
    • hi

    • +
    + + + +
      +
    • hello
    • +
    • world

      + +

      how

    • +
    • hi
    • +
    + + + +
      +
    • hello
    • +
    • world
    • +
    • how

      + +

      are

    • +
    + + + +
      +
    • hello
    • +
    • world

    • +
    • how

      + +

      are

    • +
    diff --git a/app/bower_components/marked/test/tests/loose_lists.text b/app/bower_components/marked/test/tests/loose_lists.text new file mode 100644 index 000000000..cb360a15d --- /dev/null +++ b/app/bower_components/marked/test/tests/loose_lists.text @@ -0,0 +1,59 @@ +* hello + world + + how + are +* you + + + +better behavior: + +* hello + * world + how + + are + you + + * today +* hi + + + +* hello + +* world +* hi + + + +* hello +* world + +* hi + + + +* hello +* world + + how +* hi + + + +* hello +* world +* how + + are + + + +* hello +* world + +* how + + are diff --git a/app/bower_components/marked/test/tests/main.html b/app/bower_components/marked/test/tests/main.html new file mode 100644 index 000000000..8f78c4d30 --- /dev/null +++ b/app/bower_components/marked/test/tests/main.html @@ -0,0 +1,4 @@ +

    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.
        +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.
    +Lots of it...
    diff --git a/app/bower_components/marked/test/tests/main.text b/app/bower_components/marked/test/tests/main.text new file mode 100644 index 000000000..58e17a6a7 --- /dev/null +++ b/app/bower_components/marked/test/tests/main.text @@ -0,0 +1,55 @@ +[test]: http://google.com/ "Google" + +# 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][test] 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. + 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](//hello). +And an image ![alt](src). + + Code goes here. + Lots of it... diff --git a/app/bower_components/marked/test/tests/markdown_documentation_basics.html b/app/bower_components/marked/test/tests/markdown_documentation_basics.html new file mode 100644 index 000000000..aadbce2bb --- /dev/null +++ b/app/bower_components/marked/test/tests/markdown_documentation_basics.html @@ -0,0 +1,314 @@ +

    Markdown: Basics

    + + + +

    Getting the Gist of Markdown's Formatting Syntax

    + +

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

    + +

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

    + +

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

    + +

    Paragraphs, Headers, Blockquotes

    + +

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

    + +

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

    + +

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

    + +

    Markdown:

    + +
    A First Level Header
    +====================
    +
    +A Second Level Header
    +---------------------
    +
    +Now is the time for all good men to come to
    +the aid of their country. This is just a
    +regular paragraph.
    +
    +The quick brown fox jumped over the lazy
    +dog's back.
    +
    +### Header 3
    +
    +> This is a blockquote.
    +> 
    +> This is the second paragraph in the blockquote.
    +>
    +> ## This is an H2 in a blockquote
    +
    + +

    Output:

    + +
    <h1>A First Level Header</h1>
    +
    +<h2>A Second Level Header</h2>
    +
    +<p>Now is the time for all good men to come to
    +the aid of their country. This is just a
    +regular paragraph.</p>
    +
    +<p>The quick brown fox jumped over the lazy
    +dog's back.</p>
    +
    +<h3>Header 3</h3>
    +
    +<blockquote>
    +    <p>This is a blockquote.</p>
    +
    +    <p>This is the second paragraph in the blockquote.</p>
    +
    +    <h2>This is an H2 in a blockquote</h2>
    +</blockquote>
    +
    + +

    Phrase Emphasis

    + +

    Markdown uses asterisks and underscores to indicate spans of emphasis.

    + +

    Markdown:

    + +
    Some of these words *are emphasized*.
    +Some of these words _are emphasized also_.
    +
    +Use two asterisks for **strong emphasis**.
    +Or, if you prefer, __use two underscores instead__.
    +
    + +

    Output:

    + +
    <p>Some of these words <em>are emphasized</em>.
    +Some of these words <em>are emphasized also</em>.</p>
    +
    +<p>Use two asterisks for <strong>strong emphasis</strong>.
    +Or, if you prefer, <strong>use two underscores instead</strong>.</p>
    +
    + +

    Lists

    + +

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

    + +
    *   Candy.
    +*   Gum.
    +*   Booze.
    +
    + +

    this:

    + +
    +   Candy.
    ++   Gum.
    ++   Booze.
    +
    + +

    and this:

    + +
    -   Candy.
    +-   Gum.
    +-   Booze.
    +
    + +

    all produce the same output:

    + +
    <ul>
    +<li>Candy.</li>
    +<li>Gum.</li>
    +<li>Booze.</li>
    +</ul>
    +
    + +

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

    + +
    1.  Red
    +2.  Green
    +3.  Blue
    +
    + +

    Output:

    + +
    <ol>
    +<li>Red</li>
    +<li>Green</li>
    +<li>Blue</li>
    +</ol>
    +
    + +

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

    + +
    *   A list item.
    +
    +    With multiple paragraphs.
    +
    +*   Another item in the list.
    +
    + +

    Output:

    + +
    <ul>
    +<li><p>A list item.</p>
    +<p>With multiple paragraphs.</p></li>
    +<li><p>Another item in the list.</p></li>
    +</ul>
    +
    + + + +

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

    + +

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

    + +
    This is an [example link](http://example.com/).
    +
    + +

    Output:

    + +
    <p>This is an <a href="http://example.com/">
    +example link</a>.</p>
    +
    + +

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

    + +
    This is an [example link](http://example.com/ "With a Title").
    +
    + +

    Output:

    + +
    <p>This is an <a href="http://example.com/" title="With a Title">
    +example link</a>.</p>
    +
    + +

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

    + +
    I get 10 times more traffic from [Google][1] than from
    +[Yahoo][2] or [MSN][3].
    +
    +[1]: http://google.com/        "Google"
    +[2]: http://search.yahoo.com/  "Yahoo Search"
    +[3]: http://search.msn.com/    "MSN Search"
    +
    + +

    Output:

    + +
    <p>I get 10 times more traffic from <a href="http://google.com/"
    +title="Google">Google</a> than from <a href="http://search.yahoo.com/"
    +title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
    +title="MSN Search">MSN</a>.</p>
    +
    + +

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

    + +
    I start my morning with a cup of coffee and
    +[The New York Times][NY Times].
    +
    +[ny times]: http://www.nytimes.com/
    +
    + +

    Output:

    + +
    <p>I start my morning with a cup of coffee and
    +<a href="http://www.nytimes.com/">The New York Times</a>.</p>
    +
    + +

    Images

    + +

    Image syntax is very much like link syntax.

    + +

    Inline (titles are optional):

    + +
    ![alt text](/path/to/img.jpg "Title")
    +
    + +

    Reference-style:

    + +
    ![alt text][id]
    +
    +[id]: /path/to/img.jpg "Title"
    +
    + +

    Both of the above examples produce the same output:

    + +
    <img src="/path/to/img.jpg" alt="alt text" title="Title" />
    +
    + +

    Code

    + +

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

    + +
    I strongly recommend against using any `<blink>` tags.
    +
    +I wish SmartyPants used named entities like `&mdash;`
    +instead of decimal-encoded entites like `&#8212;`.
    +
    + +

    Output:

    + +
    <p>I strongly recommend against using any
    +<code>&lt;blink&gt;</code> tags.</p>
    +
    +<p>I wish SmartyPants used named entities like
    +<code>&amp;mdash;</code> instead of decimal-encoded
    +entites like <code>&amp;#8212;</code>.</p>
    +
    + +

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

    + +

    Markdown:

    + +
    If you want your page to validate under XHTML 1.0 Strict,
    +you've got to put paragraph tags in your blockquotes:
    +
    +    <blockquote>
    +        <p>For example.</p>
    +    </blockquote>
    +
    + +

    Output:

    + +
    <p>If you want your page to validate under XHTML 1.0 Strict,
    +you've got to put paragraph tags in your blockquotes:</p>
    +
    +<pre><code>&lt;blockquote&gt;
    +    &lt;p&gt;For example.&lt;/p&gt;
    +&lt;/blockquote&gt;
    +</code></pre>
    +
    diff --git a/app/bower_components/marked/test/tests/markdown_documentation_basics.text b/app/bower_components/marked/test/tests/markdown_documentation_basics.text new file mode 100644 index 000000000..486055ca7 --- /dev/null +++ b/app/bower_components/marked/test/tests/markdown_documentation_basics.text @@ -0,0 +1,306 @@ +Markdown: Basics +================ + + + + +Getting the Gist of Markdown's Formatting Syntax +------------------------------------------------ + +This page offers a brief overview of what it's like to use Markdown. +The [syntax page] [s] provides complete, detailed documentation for +every feature, but Markdown should be very easy to pick up simply by +looking at a few examples of it in action. The examples on this page +are written in a before/after style, showing example syntax and the +HTML output produced by Markdown. + +It's also helpful to simply try Markdown out; the [Dingus] [d] is a +web application that allows you type your own Markdown-formatted text +and translate it to XHTML. + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL] [src]. + + [s]: /projects/markdown/syntax "Markdown Syntax" + [d]: /projects/markdown/dingus "Markdown Dingus" + [src]: /projects/markdown/basics.text + + +## Paragraphs, Headers, Blockquotes ## + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +Markdown offers two styles of headers: *Setext* and *atx*. +Setext-style headers for `

    ` and `

    ` are created by +"underlining" with equal signs (`=`) and hyphens (`-`), respectively. +To create an atx-style header, you put 1-6 hash marks (`#`) at the +beginning of the line -- the number of hashes equals the resulting +HTML header level. + +Blockquotes are indicated using email-style '`>`' angle brackets. + +Markdown: + + A First Level Header + ==================== + + A Second Level Header + --------------------- + + Now is the time for all good men to come to + the aid of their country. This is just a + regular paragraph. + + The quick brown fox jumped over the lazy + dog's back. + + ### Header 3 + + > This is a blockquote. + > + > This is the second paragraph in the blockquote. + > + > ## This is an H2 in a blockquote + + +Output: + +

    A First Level Header

    + +

    A Second Level Header

    + +

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

    + +

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

    + +

    Header 3

    + +
    +

    This is a blockquote.

    + +

    This is the second paragraph in the blockquote.

    + +

    This is an H2 in a blockquote

    +
    + + + +### Phrase Emphasis ### + +Markdown uses asterisks and underscores to indicate spans of emphasis. + +Markdown: + + Some of these words *are emphasized*. + Some of these words _are emphasized also_. + + Use two asterisks for **strong emphasis**. + Or, if you prefer, __use two underscores instead__. + +Output: + +

    Some of these words are emphasized. + Some of these words are emphasized also.

    + +

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

    + + + +## Lists ## + +Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, +`+`, and `-`) as list markers. These three markers are +interchangable; this: + + * Candy. + * Gum. + * Booze. + +this: + + + Candy. + + Gum. + + Booze. + +and this: + + - Candy. + - Gum. + - Booze. + +all produce the same output: + +
      +
    • Candy.
    • +
    • Gum.
    • +
    • Booze.
    • +
    + +Ordered (numbered) lists use regular numbers, followed by periods, as +list markers: + + 1. Red + 2. Green + 3. Blue + +Output: + +
      +
    1. Red
    2. +
    3. Green
    4. +
    5. Blue
    6. +
    + +If you put blank lines between items, you'll get `

    ` tags for the +list item text. You can create multi-paragraph list items by indenting +the paragraphs by 4 spaces or 1 tab: + + * A list item. + + With multiple paragraphs. + + * Another item in the list. + +Output: + +

      +
    • A list item.

      +

      With multiple paragraphs.

    • +
    • Another item in the list.

    • +
    + + + +### Links ### + +Markdown supports two styles for creating links: *inline* and +*reference*. With both styles, you use square brackets to delimit the +text you want to turn into a link. + +Inline-style links use parentheses immediately after the link text. +For example: + + This is an [example link](http://example.com/). + +Output: + +

    This is an + example link.

    + +Optionally, you may include a title attribute in the parentheses: + + This is an [example link](http://example.com/ "With a Title"). + +Output: + +

    This is an + example link.

    + +Reference-style links allow you to refer to your links by names, which +you define elsewhere in your document: + + I get 10 times more traffic from [Google][1] than from + [Yahoo][2] or [MSN][3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Output: + +

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

    + +The title attribute is optional. Link names may contain letters, +numbers and spaces, but are *not* case sensitive: + + I start my morning with a cup of coffee and + [The New York Times][NY Times]. + + [ny times]: http://www.nytimes.com/ + +Output: + +

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

    + + +### Images ### + +Image syntax is very much like link syntax. + +Inline (titles are optional): + + ![alt text](/path/to/img.jpg "Title") + +Reference-style: + + ![alt text][id] + + [id]: /path/to/img.jpg "Title" + +Both of the above examples produce the same output: + + alt text + + + +### Code ### + +In a regular paragraph, you can create code span by wrapping text in +backtick quotes. Any ampersands (`&`) and angle brackets (`<` or +`>`) will automatically be translated into HTML entities. This makes +it easy to use Markdown to write about HTML example code: + + I strongly recommend against using any `` tags. + + I wish SmartyPants used named entities like `—` + instead of decimal-encoded entites like `—`. + +Output: + +

    I strongly recommend against using any + <blink> tags.

    + +

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

    + + +To specify an entire block of pre-formatted code, indent every line of +the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, +and `>` characters will be escaped automatically. + +Markdown: + + If you want your page to validate under XHTML 1.0 Strict, + you've got to put paragraph tags in your blockquotes: + +
    +

    For example.

    +
    + +Output: + +

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

    + +
    <blockquote>
    +        <p>For example.</p>
    +    </blockquote>
    +    
    diff --git a/app/bower_components/marked/test/tests/markdown_documentation_syntax.html b/app/bower_components/marked/test/tests/markdown_documentation_syntax.html new file mode 100644 index 000000000..40e083711 --- /dev/null +++ b/app/bower_components/marked/test/tests/markdown_documentation_syntax.html @@ -0,0 +1,942 @@ +

    Markdown: Syntax

    + + + + + +

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

    + +
    + +

    Overview

    + +

    Philosophy

    + +

    Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

    + +

    Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including Setext, atx, Textile, reStructuredText, +Grutatext, and EtText -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email.

    + +

    To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like *emphasis*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email.

    + +

    Inline HTML

    + +

    Markdown's syntax is intended for one purpose: to be used as a +format for writing for the web.

    + +

    Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is not to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a publishing format; Markdown is a writing +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text.

    + +

    For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags.

    + +

    The only restrictions are that block-level HTML elements -- e.g. <div>, +<table>, <pre>, <p>, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) <p> tags around HTML block-level tags.

    + +

    For example, to add an HTML table to a Markdown article:

    + +
    This is a regular paragraph.
    +
    +<table>
    +    <tr>
    +        <td>Foo</td>
    +    </tr>
    +</table>
    +
    +This is another regular paragraph.
    +
    + +

    Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style *emphasis* inside an +HTML block.

    + +

    Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML <a> or <img> tags instead of Markdown's +link or image syntax, go right ahead.

    + +

    Unlike block-level HTML tags, Markdown syntax is processed within +span-level tags.

    + +

    Automatic Escaping for Special Characters

    + +

    In HTML, there are two characters that demand special treatment: < +and &. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. &lt;, and +&amp;.

    + +

    Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write 'AT&amp;T'. You even need to +escape ampersands within URLs. Thus, if you want to link to:

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

    you need to encode the URL as:

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

    in your anchor tag href attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites.

    + +

    Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into &amp;.

    + +

    So, if you want to include a copyright symbol in your article, you can write:

    + +
    &copy;
    +
    + +

    and Markdown will leave it alone. But if you write:

    + +
    AT&T
    +
    + +

    Markdown will translate it to:

    + +
    AT&amp;T
    +
    + +

    Similarly, because Markdown supports inline HTML, if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write:

    + +
    4 < 5
    +
    + +

    Markdown will translate it to:

    + +
    4 &lt; 5
    +
    + +

    However, inside Markdown code spans and blocks, angle brackets and +ampersands are always encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single < +and & in your example code needs to be escaped.)

    + +
    + +

    Block Elements

    + +

    Paragraphs and Line Breaks

    + +

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

    + +

    The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a <br /> tag.

    + +

    When you do want to insert a <br /> break tag using Markdown, you +end a line with two or more spaces, then type return.

    + +

    Yes, this takes a tad more effort to create a <br />, but a simplistic +"every line break is a <br />" rule wouldn't work for Markdown. +Markdown's email-style blockquoting and multi-paragraph list items +work best -- and look better -- when you format them with hard breaks.

    + + + +

    Markdown supports two styles of headers, Setext and atx.

    + +

    Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example:

    + +
    This is an H1
    +=============
    +
    +This is an H2
    +-------------
    +
    + +

    Any number of underlining ='s or -'s will work.

    + +

    Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example:

    + +
    # This is an H1
    +
    +## This is an H2
    +
    +###### This is an H6
    +
    + +

    Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) :

    + +
    # This is an H1 #
    +
    +## This is an H2 ##
    +
    +### This is an H3 ######
    +
    + +

    Blockquotes

    + +

    Markdown uses email-style > characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a > before every line:

    + +
    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    +> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    +> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    +> 
    +> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    +> id sem consectetuer libero luctus adipiscing.
    +
    + +

    Markdown allows you to be lazy and only put the > before the first +line of a hard-wrapped paragraph:

    + +
    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    +consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    +Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    +
    +> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    +id sem consectetuer libero luctus adipiscing.
    +
    + +

    Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of >:

    + +
    > This is the first level of quoting.
    +>
    +> > This is nested blockquote.
    +>
    +> Back to the first level.
    +
    + +

    Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks:

    + +
    > ## This is a header.
    +> 
    +> 1.   This is the first list item.
    +> 2.   This is the second list item.
    +> 
    +> Here's some example code:
    +> 
    +>     return shell_exec("echo $input | $markdown_script");
    +
    + +

    Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu.

    + +

    Lists

    + +

    Markdown supports ordered (numbered) and unordered (bulleted) lists.

    + +

    Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers:

    + +
    *   Red
    +*   Green
    +*   Blue
    +
    + +

    is equivalent to:

    + +
    +   Red
    ++   Green
    ++   Blue
    +
    + +

    and:

    + +
    -   Red
    +-   Green
    +-   Blue
    +
    + +

    Ordered lists use numbers followed by periods:

    + +
    1.  Bird
    +2.  McHale
    +3.  Parish
    +
    + +

    It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is:

    + +
    <ol>
    +<li>Bird</li>
    +<li>McHale</li>
    +<li>Parish</li>
    +</ol>
    +
    + +

    If you instead wrote the list in Markdown like this:

    + +
    1.  Bird
    +1.  McHale
    +1.  Parish
    +
    + +

    or even:

    + +
    3. Bird
    +1. McHale
    +8. Parish
    +
    + +

    you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to.

    + +

    If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number.

    + +

    List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab.

    + +

    To make lists look nice, you can wrap items with hanging indents:

    + +
    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    +    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    +    viverra nec, fringilla in, laoreet vitae, risus.
    +*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    +    Suspendisse id sem consectetuer libero luctus adipiscing.
    +
    + +

    But if you want to be lazy, you don't have to:

    + +
    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    +Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    +viverra nec, fringilla in, laoreet vitae, risus.
    +*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    +Suspendisse id sem consectetuer libero luctus adipiscing.
    +
    + +

    If list items are separated by blank lines, Markdown will wrap the +items in <p> tags in the HTML output. For example, this input:

    + +
    *   Bird
    +*   Magic
    +
    + +

    will turn into:

    + +
    <ul>
    +<li>Bird</li>
    +<li>Magic</li>
    +</ul>
    +
    + +

    But this:

    + +
    *   Bird
    +
    +*   Magic
    +
    + +

    will turn into:

    + +
    <ul>
    +<li><p>Bird</p></li>
    +<li><p>Magic</p></li>
    +</ul>
    +
    + +

    List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab:

    + +
    1.  This is a list item with two paragraphs. Lorem ipsum dolor
    +    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    +    mi posuere lectus.
    +
    +    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    +    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    +    sit amet velit.
    +
    +2.  Suspendisse id sem consectetuer libero luctus adipiscing.
    +
    + +

    It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy:

    + +
    *   This is a list item with two paragraphs.
    +
    +    This is the second paragraph in the list item. You're
    +only required to indent the first line. Lorem ipsum dolor
    +sit amet, consectetuer adipiscing elit.
    +
    +*   Another item in the same list.
    +
    + +

    To put a blockquote within a list item, the blockquote's > +delimiters need to be indented:

    + +
    *   A list item with a blockquote:
    +
    +    > This is a blockquote
    +    > inside a list item.
    +
    + +

    To put a code block within a list item, the code block needs +to be indented twice -- 8 spaces or two tabs:

    + +
    *   A list item with a code block:
    +
    +        <code goes here>
    +
    + +

    It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this:

    + +
    1986. What a great season.
    +
    + +

    In other words, a number-period-space sequence at the beginning of a +line. To avoid this, you can backslash-escape the period:

    + +
    1986\. What a great season.
    +
    + +

    Code Blocks

    + +

    Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both <pre> and <code> tags.

    + +

    To produce a code block in Markdown, simply indent every line of the +block by at least 4 spaces or 1 tab. For example, given this input:

    + +
    This is a normal paragraph:
    +
    +    This is a code block.
    +
    + +

    Markdown will generate:

    + +
    <p>This is a normal paragraph:</p>
    +
    +<pre><code>This is a code block.
    +</code></pre>
    +
    + +

    One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this:

    + +
    Here is an example of AppleScript:
    +
    +    tell application "Foo"
    +        beep
    +    end tell
    +
    + +

    will turn into:

    + +
    <p>Here is an example of AppleScript:</p>
    +
    +<pre><code>tell application "Foo"
    +    beep
    +end tell
    +</code></pre>
    +
    + +

    A code block continues until it reaches a line that is not indented +(or the end of the article).

    + +

    Within a code block, ampersands (&) and angle brackets (< and >) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this:

    + +
        <div class="footer">
    +        &copy; 2004 Foo Corporation
    +    </div>
    +
    + +

    will turn into:

    + +
    <pre><code>&lt;div class="footer"&gt;
    +    &amp;copy; 2004 Foo Corporation
    +&lt;/div&gt;
    +</code></pre>
    +
    + +

    Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax.

    + +

    Horizontal Rules

    + +

    You can produce a horizontal rule tag (<hr>) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule:

    + +
    * * *
    +
    +***
    +
    +*****
    +
    +- - -
    +
    +---------------------------------------
    +
    +_ _ _
    +
    + +
    + +

    Span Elements

    + + + +

    Markdown supports two style of links: inline and reference.

    + +

    In both styles, the link text is delimited by [square brackets].

    + +

    To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an optional +title for the link, surrounded in quotes. For example:

    + +
    This is [an example](http://example.com/ "Title") inline link.
    +
    +[This link](http://example.net/) has no title attribute.
    +
    + +

    Will produce:

    + +
    <p>This is <a href="http://example.com/" title="Title">
    +an example</a> inline link.</p>
    +
    +<p><a href="http://example.net/">This link</a> has no
    +title attribute.</p>
    +
    + +

    If you're referring to a local resource on the same server, you can +use relative paths:

    + +
    See my [About](/about/) page for details.
    +
    + +

    Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link:

    + +
    This is [an example][id] reference-style link.
    +
    + +

    You can optionally use a space to separate the sets of brackets:

    + +
    This is [an example] [id] reference-style link.
    +
    + +

    Then, anywhere in the document, you define your link label like this, +on a line by itself:

    + +
    [id]: http://example.com/  "Optional Title Here"
    +
    + +

    That is:

    + +
      +
    • Square brackets containing the link identifier (optionally +indented from the left margin using up to three spaces);
    • +
    • followed by a colon;
    • +
    • followed by one or more spaces (or tabs);
    • +
    • followed by the URL for the link;
    • +
    • optionally followed by a title attribute for the link, enclosed +in double or single quotes.
    • +
    + +

    The link URL may, optionally, be surrounded by angle brackets:

    + +
    [id]: <http://example.com/>  "Optional Title Here"
    +
    + +

    You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs:

    + +
    [id]: http://example.com/longish/path/to/resource/here
    +    "Optional Title Here"
    +
    + +

    Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output.

    + +

    Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

    + +
    [link text][a]
    +[link text][A]
    +
    + +

    are equivalent.

    + +

    The implicit link name shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write:

    + +
    [Google][]
    +
    + +

    And then define the link:

    + +
    [Google]: http://google.com/
    +
    + +

    Because link names may contain spaces, this shortcut even works for +multiple words in the link text:

    + +
    Visit [Daring Fireball][] for more information.
    +
    + +

    And then define the link:

    + +
    [Daring Fireball]: http://daringfireball.net/
    +
    + +

    Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes.

    + +

    Here's an example of reference links in action:

    + +
    I get 10 times more traffic from [Google] [1] than from
    +[Yahoo] [2] or [MSN] [3].
    +
    +  [1]: http://google.com/        "Google"
    +  [2]: http://search.yahoo.com/  "Yahoo Search"
    +  [3]: http://search.msn.com/    "MSN Search"
    +
    + +

    Using the implicit link name shortcut, you could instead write:

    + +
    I get 10 times more traffic from [Google][] than from
    +[Yahoo][] or [MSN][].
    +
    +  [google]: http://google.com/        "Google"
    +  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
    +  [msn]:    http://search.msn.com/    "MSN Search"
    +
    + +

    Both of the above examples will produce the following HTML output:

    + +
    <p>I get 10 times more traffic from <a href="http://google.com/"
    +title="Google">Google</a> than from
    +<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
    +or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
    +
    + +

    For comparison, here is the same paragraph written using +Markdown's inline link style:

    + +
    I get 10 times more traffic from [Google](http://google.com/ "Google")
    +than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
    +[MSN](http://search.msn.com/ "MSN Search").
    +
    + +

    The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text.

    + +

    With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose.

    + +

    Emphasis

    + +

    Markdown treats asterisks (*) and underscores (_) as indicators of +emphasis. Text wrapped with one * or _ will be wrapped with an +HTML <em> tag; double *'s or _'s will be wrapped with an HTML +<strong> tag. E.g., this input:

    + +
    *single asterisks*
    +
    +_single underscores_
    +
    +**double asterisks**
    +
    +__double underscores__
    +
    + +

    will produce:

    + +
    <em>single asterisks</em>
    +
    +<em>single underscores</em>
    +
    +<strong>double asterisks</strong>
    +
    +<strong>double underscores</strong>
    +
    + +

    You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span.

    + +

    Emphasis can be used in the middle of a word:

    + +
    un*fucking*believable
    +
    + +

    But if you surround an * or _ with spaces, it'll be treated as a +literal asterisk or underscore.

    + +

    To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it:

    + +
    \*this text is surrounded by literal asterisks\*
    +
    + +

    Code

    + +

    To indicate a span of code, wrap it with backtick quotes (`). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example:

    + +
    Use the `printf()` function.
    +
    + +

    will produce:

    + +
    <p>Use the <code>printf()</code> function.</p>
    +
    + +

    To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters:

    + +
    ``There is a literal backtick (`) here.``
    +
    + +

    which will produce this:

    + +
    <p><code>There is a literal backtick (`) here.</code></p>
    +
    + +

    The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span:

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

    will produce:

    + +
    <p>A single backtick in a code span: <code>`</code></p>
    +
    +<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
    +
    + +

    With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this:

    + +
    Please don't use any `<blink>` tags.
    +
    + +

    into:

    + +
    <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
    +
    + +

    You can write this:

    + +
    `&#8212;` is the decimal-encoded equivalent of `&mdash;`.
    +
    + +

    to produce:

    + +
    <p><code>&amp;#8212;</code> is the decimal-encoded
    +equivalent of <code>&amp;mdash;</code>.</p>
    +
    + +

    Images

    + +

    Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format.

    + +

    Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: inline and reference.

    + +

    Inline image syntax looks like this:

    + +
    ![Alt text](/path/to/img.jpg)
    +
    +![Alt text](/path/to/img.jpg "Optional title")
    +
    + +

    That is:

    + +
      +
    • An exclamation mark: !;
    • +
    • followed by a set of square brackets, containing the alt +attribute text for the image;
    • +
    • followed by a set of parentheses, containing the URL or path to +the image, and an optional title attribute enclosed in double +or single quotes.
    • +
    + +

    Reference-style image syntax looks like this:

    + +
    ![Alt text][id]
    +
    + +

    Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references:

    + +
    [id]: url/to/image  "Optional title attribute"
    +
    + +

    As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML <img> tags.

    + +
    + +

    Miscellaneous

    + + + +

    Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

    + +
    <http://example.com/>
    +
    + +

    Markdown will turn this into:

    + +
    <a href="http://example.com/">http://example.com/</a>
    +
    + +

    Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this:

    + +
    <address@example.com>
    +
    + +

    into something like this:

    + +
    <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
    +&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
    +&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
    +&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
    +
    + +

    which will render in a browser as a clickable link to "address@example.com".

    + +

    (This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.)

    + +

    Backslash Escapes

    + +

    Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML <em> tag), you can backslashes +before the asterisks, like this:

    + +
    \*literal asterisks\*
    +
    + +

    Markdown provides backslash escapes for the following characters:

    + +
    \   backslash
    +`   backtick
    +*   asterisk
    +_   underscore
    +{}  curly braces
    +[]  square brackets
    +()  parentheses
    +#   hash mark
    ++   plus sign
    +-   minus sign (hyphen)
    +.   dot
    +!   exclamation mark
    +
    diff --git a/app/bower_components/marked/test/tests/markdown_documentation_syntax.text b/app/bower_components/marked/test/tests/markdown_documentation_syntax.text new file mode 100644 index 000000000..79287abc9 --- /dev/null +++ b/app/bower_components/marked/test/tests/markdown_documentation_syntax.text @@ -0,0 +1,888 @@ +Markdown: Syntax +================ + + + + +* [Overview](#overview) + * [Philosophy](#philosophy) + * [Inline HTML](#html) + * [Automatic Escaping for Special Characters](#autoescape) +* [Block Elements](#block) + * [Paragraphs and Line Breaks](#p) + * [Headers](#header) + * [Blockquotes](#blockquote) + * [Lists](#list) + * [Code Blocks](#precode) + * [Horizontal Rules](#hr) +* [Span Elements](#span) + * [Links](#link) + * [Emphasis](#em) + * [Code](#code) + * [Images](#img) +* [Miscellaneous](#misc) + * [Backslash Escapes](#backslash) + * [Automatic Links](#autolink) + + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL][src]. + + [src]: /projects/markdown/syntax.text + +* * * + +

    Overview

    + +

    Philosophy

    + +Markdown is intended to be as easy-to-read and easy-to-write as is feasible. + +Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], +[Grutatext] [5], and [EtText] [6] -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email. + + [1]: http://docutils.sourceforge.net/mirror/setext.html + [2]: http://www.aaronsw.com/2002/atx/ + [3]: http://textism.com/tools/textile/ + [4]: http://docutils.sourceforge.net/rst.html + [5]: http://www.triptico.com/software/grutatxt.html + [6]: http://ettext.taint.org/doc/ + +To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like \*emphasis\*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email. + + + +

    Inline HTML

    + +Markdown's syntax is intended for one purpose: to be used as a +format for *writing* for the web. + +Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is *not* to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a *publishing* format; Markdown is a *writing* +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text. + +For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags. + +The only restrictions are that block-level HTML elements -- e.g. `
    `, +``, `
    `, `

    `, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) `

    ` tags around HTML block-level tags. + +For example, to add an HTML table to a Markdown article: + + This is a regular paragraph. + +

    + + + +
    Foo
    + + This is another regular paragraph. + +Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an +HTML block. + +Span-level HTML tags -- e.g. ``, ``, or `` -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML `` or `` tags instead of Markdown's +link or image syntax, go right ahead. + +Unlike block-level HTML tags, Markdown syntax *is* processed within +span-level tags. + + +

    Automatic Escaping for Special Characters

    + +In HTML, there are two characters that demand special treatment: `<` +and `&`. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. `<`, and +`&`. + +Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write '`AT&T`'. You even need to +escape ampersands within URLs. Thus, if you want to link to: + + http://images.google.com/images?num=30&q=larry+bird + +you need to encode the URL as: + + http://images.google.com/images?num=30&q=larry+bird + +in your anchor tag `href` attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites. + +Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into `&`. + +So, if you want to include a copyright symbol in your article, you can write: + + © + +and Markdown will leave it alone. But if you write: + + AT&T + +Markdown will translate it to: + + AT&T + +Similarly, because Markdown supports [inline HTML](#html), if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write: + + 4 < 5 + +Markdown will translate it to: + + 4 < 5 + +However, inside Markdown code spans and blocks, angle brackets and +ampersands are *always* encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single `<` +and `&` in your example code needs to be escaped.) + + +* * * + + +

    Block Elements

    + + +

    Paragraphs and Line Breaks

    + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing but spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a `
    ` tag. + +When you *do* want to insert a `
    ` break tag using Markdown, you +end a line with two or more spaces, then type return. + +Yes, this takes a tad more effort to create a `
    `, but a simplistic +"every line break is a `
    `" rule wouldn't work for Markdown. +Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] +work best -- and look better -- when you format them with hard breaks. + + [bq]: #blockquote + [l]: #list + + + + + +Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. + +Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example: + + This is an H1 + ============= + + This is an H2 + ------------- + +Any number of underlining `=`'s or `-`'s will work. + +Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example: + + # This is an H1 + + ## This is an H2 + + ###### This is an H6 + +Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) : + + # This is an H1 # + + ## This is an H2 ## + + ### This is an H3 ###### + + +

    Blockquotes

    + +Markdown uses email-style `>` characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a `>` before every line: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + > + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + > id sem consectetuer libero luctus adipiscing. + +Markdown allows you to be lazy and only put the `>` before the first +line of a hard-wrapped paragraph: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + id sem consectetuer libero luctus adipiscing. + +Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of `>`: + + > This is the first level of quoting. + > + > > This is nested blockquote. + > + > Back to the first level. + +Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks: + + > ## This is a header. + > + > 1. This is the first list item. + > 2. This is the second list item. + > + > Here's some example code: + > + > return shell_exec("echo $input | $markdown_script"); + +Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu. + + +

    Lists

    + +Markdown supports ordered (numbered) and unordered (bulleted) lists. + +Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers: + + * Red + * Green + * Blue + +is equivalent to: + + + Red + + Green + + Blue + +and: + + - Red + - Green + - Blue + +Ordered lists use numbers followed by periods: + + 1. Bird + 2. McHale + 3. Parish + +It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is: + +
      +
    1. Bird
    2. +
    3. McHale
    4. +
    5. Parish
    6. +
    + +If you instead wrote the list in Markdown like this: + + 1. Bird + 1. McHale + 1. Parish + +or even: + + 3. Bird + 1. McHale + 8. Parish + +you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to. + +If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number. + +List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab. + +To make lists look nice, you can wrap items with hanging indents: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +But if you want to be lazy, you don't have to: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +If list items are separated by blank lines, Markdown will wrap the +items in `

    ` tags in the HTML output. For example, this input: + + * Bird + * Magic + +will turn into: + +

      +
    • Bird
    • +
    • Magic
    • +
    + +But this: + + * Bird + + * Magic + +will turn into: + +
      +
    • Bird

    • +
    • Magic

    • +
    + +List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab: + + 1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + Vestibulum enim wisi, viverra nec, fringilla in, laoreet + vitae, risus. Donec sit amet nisl. Aliquam semper ipsum + sit amet velit. + + 2. Suspendisse id sem consectetuer libero luctus adipiscing. + +It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy: + + * This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're + only required to indent the first line. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. + + * Another item in the same list. + +To put a blockquote within a list item, the blockquote's `>` +delimiters need to be indented: + + * A list item with a blockquote: + + > This is a blockquote + > inside a list item. + +To put a code block within a list item, the code block needs +to be indented *twice* -- 8 spaces or two tabs: + + * A list item with a code block: + + + + +It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this: + + 1986. What a great season. + +In other words, a *number-period-space* sequence at the beginning of a +line. To avoid this, you can backslash-escape the period: + + 1986\. What a great season. + + + +

    Code Blocks

    + +Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both `
    ` and `` tags.
    +
    +To produce a code block in Markdown, simply indent every line of the
    +block by at least 4 spaces or 1 tab. For example, given this input:
    +
    +    This is a normal paragraph:
    +
    +        This is a code block.
    +
    +Markdown will generate:
    +
    +    

    This is a normal paragraph:

    + +
    This is a code block.
    +    
    + +One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this: + + Here is an example of AppleScript: + + tell application "Foo" + beep + end tell + +will turn into: + +

    Here is an example of AppleScript:

    + +
    tell application "Foo"
    +        beep
    +    end tell
    +    
    + +A code block continues until it reaches a line that is not indented +(or the end of the article). + +Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this: + + + +will turn into: + +
    <div class="footer">
    +        &copy; 2004 Foo Corporation
    +    </div>
    +    
    + +Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax. + + + +

    Horizontal Rules

    + +You can produce a horizontal rule tag (`
    `) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule: + + * * * + + *** + + ***** + + - - - + + --------------------------------------- + + _ _ _ + + +* * * + +

    Span Elements

    + + + +Markdown supports two style of links: *inline* and *reference*. + +In both styles, the link text is delimited by [square brackets]. + +To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an *optional* +title for the link, surrounded in quotes. For example: + + This is [an example](http://example.com/ "Title") inline link. + + [This link](http://example.net/) has no title attribute. + +Will produce: + +

    This is + an example inline link.

    + +

    This link has no + title attribute.

    + +If you're referring to a local resource on the same server, you can +use relative paths: + + See my [About](/about/) page for details. + +Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link: + + This is [an example][id] reference-style link. + +You can optionally use a space to separate the sets of brackets: + + This is [an example] [id] reference-style link. + +Then, anywhere in the document, you define your link label like this, +on a line by itself: + + [id]: http://example.com/ "Optional Title Here" + +That is: + +* Square brackets containing the link identifier (optionally + indented from the left margin using up to three spaces); +* followed by a colon; +* followed by one or more spaces (or tabs); +* followed by the URL for the link; +* optionally followed by a title attribute for the link, enclosed + in double or single quotes. + +The link URL may, optionally, be surrounded by angle brackets: + + [id]: "Optional Title Here" + +You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs: + + [id]: http://example.com/longish/path/to/resource/here + "Optional Title Here" + +Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output. + +Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: + + [link text][a] + [link text][A] + +are equivalent. + +The *implicit link name* shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write: + + [Google][] + +And then define the link: + + [Google]: http://google.com/ + +Because link names may contain spaces, this shortcut even works for +multiple words in the link text: + + Visit [Daring Fireball][] for more information. + +And then define the link: + + [Daring Fireball]: http://daringfireball.net/ + +Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes. + +Here's an example of reference links in action: + + I get 10 times more traffic from [Google] [1] than from + [Yahoo] [2] or [MSN] [3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Using the implicit link name shortcut, you could instead write: + + I get 10 times more traffic from [Google][] than from + [Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" + +Both of the above examples will produce the following HTML output: + +

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

    + +For comparison, here is the same paragraph written using +Markdown's inline link style: + + I get 10 times more traffic from [Google](http://google.com/ "Google") + than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or + [MSN](http://search.msn.com/ "MSN Search"). + +The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text. + +With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose. + + +

    Emphasis

    + +Markdown treats asterisks (`*`) and underscores (`_`) as indicators of +emphasis. Text wrapped with one `*` or `_` will be wrapped with an +HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML +`` tag. E.g., this input: + + *single asterisks* + + _single underscores_ + + **double asterisks** + + __double underscores__ + +will produce: + + single asterisks + + single underscores + + double asterisks + + double underscores + +You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span. + +Emphasis can be used in the middle of a word: + + un*fucking*believable + +But if you surround an `*` or `_` with spaces, it'll be treated as a +literal asterisk or underscore. + +To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it: + + \*this text is surrounded by literal asterisks\* + + + +

    Code

    + +To indicate a span of code, wrap it with backtick quotes (`` ` ``). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example: + + Use the `printf()` function. + +will produce: + +

    Use the printf() function.

    + +To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters: + + ``There is a literal backtick (`) here.`` + +which will produce this: + +

    There is a literal backtick (`) here.

    + +The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span: + + A single backtick in a code span: `` ` `` + + A backtick-delimited string in a code span: `` `foo` `` + +will produce: + +

    A single backtick in a code span: `

    + +

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

    + +With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this: + + Please don't use any `` tags. + +into: + +

    Please don't use any <blink> tags.

    + +You can write this: + + `—` is the decimal-encoded equivalent of `—`. + +to produce: + +

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

    + + + +

    Images

    + +Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format. + +Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: *inline* and *reference*. + +Inline image syntax looks like this: + + ![Alt text](/path/to/img.jpg) + + ![Alt text](/path/to/img.jpg "Optional title") + +That is: + +* An exclamation mark: `!`; +* followed by a set of square brackets, containing the `alt` + attribute text for the image; +* followed by a set of parentheses, containing the URL or path to + the image, and an optional `title` attribute enclosed in double + or single quotes. + +Reference-style image syntax looks like this: + + ![Alt text][id] + +Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references: + + [id]: url/to/image "Optional title attribute" + +As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML `` tags. + + +* * * + + +

    Miscellaneous

    + + + +Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: + + + +Markdown will turn this into: + + http://example.com/ + +Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this: + + + +into something like this: + + address@exa + mple.com + +which will render in a browser as a clickable link to "address@example.com". + +(This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.) + + + +

    Backslash Escapes

    + +Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML `` tag), you can backslashes +before the asterisks, like this: + + \*literal asterisks\* + +Markdown provides backslash escapes for the following characters: + + \ backslash + ` backtick + * asterisk + _ underscore + {} curly braces + [] square brackets + () parentheses + # hash mark + + plus sign + - minus sign (hyphen) + . dot + ! exclamation mark + diff --git a/app/bower_components/marked/test/tests/nested_blockquotes.html b/app/bower_components/marked/test/tests/nested_blockquotes.html new file mode 100644 index 000000000..d8ec7f8e0 --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_blockquotes.html @@ -0,0 +1,9 @@ +
    +

    foo

    + +
    +

    bar

    +
    + +

    foo

    +
    diff --git a/app/bower_components/marked/test/tests/nested_blockquotes.text b/app/bower_components/marked/test/tests/nested_blockquotes.text new file mode 100644 index 000000000..ed3c624ff --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_blockquotes.text @@ -0,0 +1,5 @@ +> foo +> +> > bar +> +> foo diff --git a/app/bower_components/marked/test/tests/nested_code.html b/app/bower_components/marked/test/tests/nested_code.html new file mode 100644 index 000000000..c37059201 --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_code.html @@ -0,0 +1 @@ +

    hi ther `` ok ```

    diff --git a/app/bower_components/marked/test/tests/nested_code.text b/app/bower_components/marked/test/tests/nested_code.text new file mode 100644 index 000000000..910e3d462 --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_code.text @@ -0,0 +1 @@ +````` hi ther `` ok ``` ````` diff --git a/app/bower_components/marked/test/tests/nested_em.html b/app/bower_components/marked/test/tests/nested_em.html new file mode 100644 index 000000000..3ab4ec89c --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_em.html @@ -0,0 +1,3 @@ +

    test test test

    + +

    test test test

    diff --git a/app/bower_components/marked/test/tests/nested_em.text b/app/bower_components/marked/test/tests/nested_em.text new file mode 100644 index 000000000..550d0eb99 --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_em.text @@ -0,0 +1,3 @@ +*test **test** test* + +_test __test__ test_ diff --git a/app/bower_components/marked/test/tests/nested_square_link.html b/app/bower_components/marked/test/tests/nested_square_link.html new file mode 100644 index 000000000..c8b794083 --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_square_link.html @@ -0,0 +1 @@ +

    the ] character

    diff --git a/app/bower_components/marked/test/tests/nested_square_link.text b/app/bower_components/marked/test/tests/nested_square_link.text new file mode 100644 index 000000000..82226ed5f --- /dev/null +++ b/app/bower_components/marked/test/tests/nested_square_link.text @@ -0,0 +1 @@ +[the `]` character](/url) diff --git a/app/bower_components/marked/test/tests/not_a_link.html b/app/bower_components/marked/test/tests/not_a_link.html new file mode 100644 index 000000000..a01685d24 --- /dev/null +++ b/app/bower_components/marked/test/tests/not_a_link.html @@ -0,0 +1 @@ +

    [test](not a link)

    diff --git a/app/bower_components/marked/test/tests/not_a_link.text b/app/bower_components/marked/test/tests/not_a_link.text new file mode 100644 index 000000000..26f60437d --- /dev/null +++ b/app/bower_components/marked/test/tests/not_a_link.text @@ -0,0 +1 @@ +\[test](not a link) diff --git a/app/bower_components/marked/test/tests/ordered_and_unordered_lists.html b/app/bower_components/marked/test/tests/ordered_and_unordered_lists.html new file mode 100644 index 000000000..3ab61229a --- /dev/null +++ b/app/bower_components/marked/test/tests/ordered_and_unordered_lists.html @@ -0,0 +1,148 @@ +

    Unordered

    + +

    Asterisks tight:

    + +
      +
    • asterisk 1
    • +
    • asterisk 2
    • +
    • asterisk 3
    • +
    + +

    Asterisks loose:

    + +
      +
    • asterisk 1

    • +
    • asterisk 2

    • +
    • asterisk 3

    • +
    + +
    + +

    Pluses tight:

    + +
      +
    • Plus 1
    • +
    • Plus 2
    • +
    • Plus 3
    • +
    + +

    Pluses loose:

    + +
      +
    • Plus 1

    • +
    • Plus 2

    • +
    • Plus 3

    • +
    + +
    + +

    Minuses tight:

    + +
      +
    • Minus 1
    • +
    • Minus 2
    • +
    • Minus 3
    • +
    + +

    Minuses loose:

    + +
      +
    • Minus 1

    • +
    • Minus 2

    • +
    • Minus 3

    • +
    + +

    Ordered

    + +

    Tight:

    + +
      +
    1. First
    2. +
    3. Second
    4. +
    5. Third
    6. +
    + +

    and:

    + +
      +
    1. One
    2. +
    3. Two
    4. +
    5. Three
    6. +
    + +

    Loose using tabs:

    + +
      +
    1. First

    2. +
    3. Second

    4. +
    5. Third

    6. +
    + +

    and using spaces:

    + +
      +
    1. One

    2. +
    3. Two

    4. +
    5. Three

    6. +
    + +

    Multiple paragraphs:

    + +
      +
    1. Item 1, graf one.

      + +

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

    2. +
    3. Item 2.

    4. +
    5. Item 3.

    6. +
    + +

    Nested

    + +
      +
    • Tab +
        +
      • Tab +
          +
        • Tab
        • +
      • +
    • +
    + +

    Here's another:

    + +
      +
    1. First
    2. +
    3. Second: +
        +
      • Fee
      • +
      • Fie
      • +
      • Foe
      • +
    4. +
    5. Third
    6. +
    + +

    Same thing but with paragraphs:

    + +
      +
    1. First

    2. +
    3. Second:

      + +
        +
      • Fee
      • +
      • Fie
      • +
      • Foe
      • +
    4. +
    5. Third

    6. +
    + + +

    This was an error in Markdown 1.0.1:

    + +
      +
    • this

      + +
      • sub
      + +

      that

    • +
    diff --git a/app/bower_components/marked/test/tests/ordered_and_unordered_lists.text b/app/bower_components/marked/test/tests/ordered_and_unordered_lists.text new file mode 100644 index 000000000..7f3b49777 --- /dev/null +++ b/app/bower_components/marked/test/tests/ordered_and_unordered_lists.text @@ -0,0 +1,131 @@ +## Unordered + +Asterisks tight: + +* asterisk 1 +* asterisk 2 +* asterisk 3 + + +Asterisks loose: + +* asterisk 1 + +* asterisk 2 + +* asterisk 3 + +* * * + +Pluses tight: + ++ Plus 1 ++ Plus 2 ++ Plus 3 + + +Pluses loose: + ++ Plus 1 + ++ Plus 2 + ++ Plus 3 + +* * * + + +Minuses tight: + +- Minus 1 +- Minus 2 +- Minus 3 + + +Minuses loose: + +- Minus 1 + +- Minus 2 + +- Minus 3 + + +## Ordered + +Tight: + +1. First +2. Second +3. Third + +and: + +1. One +2. Two +3. Three + + +Loose using tabs: + +1. First + +2. Second + +3. Third + +and using spaces: + +1. One + +2. Two + +3. Three + +Multiple paragraphs: + +1. Item 1, graf one. + + Item 2. graf two. The quick brown fox jumped over the lazy dog's + back. + +2. Item 2. + +3. Item 3. + + + +## Nested + +* Tab + * Tab + * Tab + +Here's another: + +1. First +2. Second: + * Fee + * Fie + * Foe +3. Third + +Same thing but with paragraphs: + +1. First + +2. Second: + * Fee + * Fie + * Foe + +3. Third + + +This was an error in Markdown 1.0.1: + +* this + + * sub + + that diff --git a/app/bower_components/marked/test/tests/ref_paren.html b/app/bower_components/marked/test/tests/ref_paren.html new file mode 100644 index 000000000..cff6977fb --- /dev/null +++ b/app/bower_components/marked/test/tests/ref_paren.html @@ -0,0 +1 @@ +

    hi

    diff --git a/app/bower_components/marked/test/tests/ref_paren.text b/app/bower_components/marked/test/tests/ref_paren.text new file mode 100644 index 000000000..aa97c91ae --- /dev/null +++ b/app/bower_components/marked/test/tests/ref_paren.text @@ -0,0 +1,3 @@ +[hi] + +[hi]: /url (there) diff --git a/app/bower_components/marked/test/tests/same_bullet.html b/app/bower_components/marked/test/tests/same_bullet.html new file mode 100644 index 000000000..9220741c0 --- /dev/null +++ b/app/bower_components/marked/test/tests/same_bullet.html @@ -0,0 +1,5 @@ +
      +
    • test
    • +
    • test
    • +
    • test
    • +
    diff --git a/app/bower_components/marked/test/tests/same_bullet.text b/app/bower_components/marked/test/tests/same_bullet.text new file mode 100644 index 000000000..27a89675a --- /dev/null +++ b/app/bower_components/marked/test/tests/same_bullet.text @@ -0,0 +1,3 @@ +* test ++ test +- test diff --git a/app/bower_components/marked/test/tests/strong_and_em_together.html b/app/bower_components/marked/test/tests/strong_and_em_together.html new file mode 100644 index 000000000..71ec78c70 --- /dev/null +++ b/app/bower_components/marked/test/tests/strong_and_em_together.html @@ -0,0 +1,7 @@ +

    This is strong and em.

    + +

    So is this word.

    + +

    This is strong and em.

    + +

    So is this word.

    diff --git a/app/bower_components/marked/test/tests/strong_and_em_together.text b/app/bower_components/marked/test/tests/strong_and_em_together.text new file mode 100644 index 000000000..95ee690db --- /dev/null +++ b/app/bower_components/marked/test/tests/strong_and_em_together.text @@ -0,0 +1,7 @@ +***This is strong and em.*** + +So is ***this*** word. + +___This is strong and em.___ + +So is ___this___ word. diff --git a/app/bower_components/marked/test/tests/tabs.html b/app/bower_components/marked/test/tests/tabs.html new file mode 100644 index 000000000..3301ba803 --- /dev/null +++ b/app/bower_components/marked/test/tests/tabs.html @@ -0,0 +1,25 @@ +
      +
    • this is a list item +indented with tabs

    • +
    • this is a list item +indented with spaces

    • +
    + +

    Code:

    + +
    this code block is indented by one tab
    +
    + +

    And:

    + +
        this code block is indented by two tabs
    +
    + +

    And:

    + +
    +   this is an example list item
    +    indented with tabs
    +
    ++   this is an example list item
    +    indented with spaces
    +
    diff --git a/app/bower_components/marked/test/tests/tabs.text b/app/bower_components/marked/test/tests/tabs.text new file mode 100644 index 000000000..589d1136e --- /dev/null +++ b/app/bower_components/marked/test/tests/tabs.text @@ -0,0 +1,21 @@ ++ this is a list item + indented with tabs + ++ this is a list item + indented with spaces + +Code: + + this code block is indented by one tab + +And: + + this code block is indented by two tabs + +And: + + + this is an example list item + indented with tabs + + + this is an example list item + indented with spaces diff --git a/app/bower_components/marked/test/tests/text.smartypants.html b/app/bower_components/marked/test/tests/text.smartypants.html new file mode 100644 index 000000000..22997c4c1 --- /dev/null +++ b/app/bower_components/marked/test/tests/text.smartypants.html @@ -0,0 +1,6 @@ +

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

    + +

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

    + +

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

    diff --git a/app/bower_components/marked/test/tests/text.smartypants.text b/app/bower_components/marked/test/tests/text.smartypants.text new file mode 100644 index 000000000..d91c8dc38 --- /dev/null +++ b/app/bower_components/marked/test/tests/text.smartypants.text @@ -0,0 +1,6 @@ +Hello world 'how' "are" you -- today... + +"It's a more 'challenging' smartypants test..." + +'And,' as a bonus -- "one +multiline" test! diff --git a/app/bower_components/marked/test/tests/tidyness.html b/app/bower_components/marked/test/tests/tidyness.html new file mode 100644 index 000000000..f2a8ce70f --- /dev/null +++ b/app/bower_components/marked/test/tests/tidyness.html @@ -0,0 +1,8 @@ +
    +

    A list within a blockquote:

    +
      +
    • asterisk 1
    • +
    • asterisk 2
    • +
    • asterisk 3
    • +
    +
    diff --git a/app/bower_components/marked/test/tests/tidyness.text b/app/bower_components/marked/test/tests/tidyness.text new file mode 100644 index 000000000..5f18b8da2 --- /dev/null +++ b/app/bower_components/marked/test/tests/tidyness.text @@ -0,0 +1,5 @@ +> A list within a blockquote: +> +> * asterisk 1 +> * asterisk 2 +> * asterisk 3 diff --git a/app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.html b/app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.html new file mode 100644 index 000000000..970c6f19f --- /dev/null +++ b/app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.html @@ -0,0 +1,34 @@ +

    hello world + how are you + how are you

    + +

    hello world

    +
    how are you
    + +

    hello world

    +
    + +

    hello world

    +

    how are you

    + +

    hello world

    +

    how are you

    + +

    hello world

    +

    how are you

    + +

    hello world

    +
    • how are you
    + +

    hello world

    +
    how are you
    + +

    hello world +how are you

    + +

    hello world +

    + +
    hello
    + +

    hello

    diff --git a/app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.text b/app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.text new file mode 100644 index 000000000..66366c07c --- /dev/null +++ b/app/bower_components/marked/test/tests/toplevel_paragraphs.gfm.text @@ -0,0 +1,37 @@ +hello world + how are you + how are you + +hello world +``` +how are you +``` + +hello world +* * * + +hello world +# how are you + +hello world +how are you +=========== + +hello world +> how are you + +hello world +* how are you + +hello world +
    how are you
    + +hello world +how are you + +hello [world][how] +[how]: /are/you + +
    hello
    + +hello diff --git a/app/bower_components/marked/test/tests/tricky_list.html b/app/bower_components/marked/test/tests/tricky_list.html new file mode 100644 index 000000000..764a3352b --- /dev/null +++ b/app/bower_components/marked/test/tests/tricky_list.html @@ -0,0 +1,23 @@ +

    hello world

    + +
      +
    • hello world
    • +
    + +

    hello world

    + +
      +
    • hello world
    • +
    + +

    hello world

    + +
      +
    • Hello world
    • +
    + +

    hello world

    + +
      +
    • hello world
    • +
    diff --git a/app/bower_components/marked/test/tests/tricky_list.text b/app/bower_components/marked/test/tests/tricky_list.text new file mode 100644 index 000000000..9aa76ceb9 --- /dev/null +++ b/app/bower_components/marked/test/tests/tricky_list.text @@ -0,0 +1,15 @@ +**hello** _world_ + +* hello world + +**hello** _world_ + +* hello world + +**hello** _world_ + +* Hello world + +**hello** _world_ + +* hello world diff --git a/index.html b/index.html index b75fe3b14..823045d8d 100644 --- a/index.html +++ b/index.html @@ -6,11 +6,8 @@ - - - - - + + diff --git a/js/ditto.js b/js/ditto.js new file mode 100644 index 000000000..83034058a --- /dev/null +++ b/js/ditto.js @@ -0,0 +1,197 @@ +var ditto = { + // page element ids + content_id: "#content", + sidebar_id: "#sidebar", + edit_id: "#edit", + back_to_top_id: "#back_to_top", + loading_id: "#loading", + error_id: "#error", + + // display elements + sidebar: true, + edit_button: true, + back_to_top_button: true, + + // initialize function + run: initialize +}; + +function initialize() { + // initialize sidebar and buttons + if (ditto.sidebar) { + init_sidebar_section(); + } + + if (ditto.back_to_top_button) { + init_back_to_top_button(); + } + + if (ditto.edit_button) { + init_edit_button(); + } + + // page router + router(); + $(window).on('hashchange', router); +} + +function init_sidebar_section() { + $.get(ditto.sidebar_file, function(data) { + $(ditto.sidebar_id).html(marked(data)); + }, "text").fail(function() { + alert("Opps! can't find the sidebar file to display!"); + }); + +} + +function init_back_to_top_button() { + $(ditto.back_to_top_id).show(); + $(ditto.back_to_top_id).on("click", function() { + $("html body").animate({ + scrollTop: 0 + }, 200); + }); +} + +function init_edit_button() { + if (ditto.base_url === null) { + alert("Error! You didn't set 'base_url' when calling ditto.run()!"); + + } else { + $(ditto.edit_id).show(); + $(ditto.edit_id).on("click", function() { + var hash = location.hash.replace("#", "/"); + + if (hash === "") { + hash = "/" + ditto.index.replace(".md", ""); + } + + window.open(ditto.base_url + hash + ".md"); + // open is better than redirecting, as the previous page history + // with redirect is a bit messed up + }); + } +} + +function replace_symbols(text) { + // replace symbols with underscore + return text.replace(/[&\/\\#,+=()$~%.'":*?<>{}\ \]\[]/g, "_"); +} + +function li_create_linkage(li_tag, header_level) { + // add custom id and class attributes + html_safe_tag = replace_symbols(li_tag.text()); + li_tag.attr("id", html_safe_tag); + li_tag.attr("class", "link"); + + // add click listener - on click scroll to relevant header section + $(ditto.content_id + " li#" + li_tag.attr("id")).click(function() { + // scroll to relevant section + var header = $( + ditto.content_id + " h" + header_level + "." + li_tag.attr("id") + ); + $('html, body').animate({ + scrollTop: header.offset().top + }, 200); + + // highlight the relevant section + original_color = header.css("color"); + header.animate({ color: "#ED1C24", }, 500, function() { + // revert back to orig color + $(this).animate({color: original_color}, 2500); + }); + }); +} + +function create_page_anchors() { + // create page anchors by matching li's to headers + // if there is a match, create click listeners + // and scroll to relevant sections + + // go through header level 2 and 3 + for (var i = 2; i <= 4; i++) { + // parse all headers + var headers = []; + $('#content h' + i).map(function() { + headers.push($(this).text()); + $(this).addClass(replace_symbols($(this).text())); + }); + + // parse and set links between li and h2 + $('#content ul li').map(function() { + for (var j = 0; j < headers.length; j++) { + if (headers[j] === $(this).text()) { + li_create_linkage($(this), i); + } + } + }); + } +} + +function normalize_paths() { + // images + $(ditto.content_id + " img").map(function() { + var src = $(this).attr("src").replace("./", ""); + if ($(this).attr("src").slice(0, 5) !== "http") { + var url = location.hash.replace("#", ""); + + // split and extract base dir + url = url.split("/"); + var base_dir = url.slice(0, url.length - 1).toString(); + + // normalize the path (i.e. make it absolute) + $(this).attr("src", base_dir + "/" + src); + } + }); + +} + +function show_error() { + console.log("SHOW ERORR!"); + $(ditto.error_id).show(); +} + +function show_loading() { + $(ditto.loading_id).show(); + $(ditto.content_id).html(""); // clear content + + // infinite loop until clearInterval() is called on loading + var loading = setInterval(function() { + $(ditto.loading_id).fadeIn(1000).fadeOut(1000); + }, 2000); + + return loading; +} + +function router() { + var path = location.hash.replace("#", "./"); + + // default page if hash is empty + if (location.pathname === "/index.html") { + path = location.pathname.replace("index.html", ditto.index); + normalize_paths(); + } else if (path === "") { + path = window.location + ditto.index; + normalize_paths(); + } else { + path = path + ".md"; + } + + // otherwise get the markdown and render it + var loading = show_loading(); + $.get(path , function(data) { + $(ditto.error_id).hide(); + $(ditto.content_id).html(marked(data)); + + normalize_paths(); + create_page_anchors(); + + }).fail(function() { + show_error(); + + }).always(function() { + clearInterval(loading); + $(ditto.loading_id).hide(); + + }); +} diff --git a/js/marked.js b/js/marked.js new file mode 100644 index 000000000..005b6f8e4 --- /dev/null +++ b/js/marked.js @@ -0,0 +1 @@ +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file