|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494 |
- name: basic
- label: basic external link
- input: "http://example.com/"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com/"), ExternalLinkClose()]
-
- ---
-
- name: basic_brackets
- label: basic external link in brackets
- input: "[http://example.com/]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com/"), ExternalLinkClose()]
-
- ---
-
- name: brackets_space
- label: basic external link in brackets, with a space after
- input: "[http://example.com/ ]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com/"), ExternalLinkSeparator(), ExternalLinkClose()]
-
- ---
-
- name: brackets_title
- label: basic external link in brackets, with a title
- input: "[http://example.com/ Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com/"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: brackets_multiword_title
- label: basic external link in brackets, with a multi-word title
- input: "[http://example.com/ Example Web Page]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com/"), ExternalLinkSeparator(), Text(text="Example Web Page"), ExternalLinkClose()]
-
- ---
-
- name: brackets_adjacent
- label: three adjacent bracket-enclosed external links
- input: "[http://foo.com/ Foo][http://bar.com/ Bar]\n[http://baz.com/ Baz]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://foo.com/"), ExternalLinkSeparator(), Text(text="Foo"), ExternalLinkClose(), ExternalLinkOpen(brackets=True), Text(text="http://bar.com/"), ExternalLinkSeparator(), Text(text="Bar"), ExternalLinkClose(), Text(text="\n"), ExternalLinkOpen(brackets=True), Text(text="http://baz.com/"), ExternalLinkSeparator(), Text(text="Baz"), ExternalLinkClose()]
-
- ---
-
- name: brackets_newline_before
- label: bracket-enclosed link with a newline before the title
- input: "[http://example.com/ \nExample]"
- output: [Text(text="["), ExternalLinkOpen(brackets=False), Text(text="http://example.com/"), ExternalLinkClose(), Text(text=" \nExample]")]
-
- ---
-
- name: brackets_newline_inside
- label: bracket-enclosed link with a newline in the title
- input: "[http://example.com/ Example \nWeb Page]"
- output: [Text(text="["), ExternalLinkOpen(brackets=False), Text(text="http://example.com/"), ExternalLinkClose(), Text(text=" Example \nWeb Page]")]
-
- ---
-
- name: brackets_newline_after
- label: bracket-enclosed link with a newline after the title
- input: "[http://example.com/ Example\n]"
- output: [Text(text="["), ExternalLinkOpen(brackets=False), Text(text="http://example.com/"), ExternalLinkClose(), Text(text=" Example\n]")]
-
- ---
-
- name: brackets_space_before
- label: bracket-enclosed link with a space before the URL
- input: "[ http://example.com Example]"
- output: [Text(text="[ "), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text=" Example]")]
-
- ---
-
- name: brackets_title_like_url
- label: bracket-enclosed link with a title that looks like a URL
- input: "[http://example.com http://example.com]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com"), ExternalLinkSeparator(), Text(text="http://example.com"), ExternalLinkClose()]
-
- ---
-
- name: brackets_recursive
- label: bracket-enclosed link with a bracket-enclosed link as the title
- input: "[http://example.com [http://example.com]]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com"), ExternalLinkSeparator(), Text(text="[http://example.com"), ExternalLinkClose(), Text(text="]")]
-
- ---
-
- name: brackets_recursive_2
- label: bracket-enclosed link with a double bracket-enclosed link as the title
- input: "[http://example.com [[http://example.com]]]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com"), ExternalLinkSeparator(), Text(text="[[http://example.com"), ExternalLinkClose(), Text(text="]]")]
-
- ---
-
- name: period_after
- label: a period after a free link that is excluded
- input: "http://example.com."
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text=".")]
-
- ---
-
- name: colons_after
- label: colons after a free link that are excluded
- input: "http://example.com/foo:bar.:;baz!?,"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com/foo:bar.:;baz"), ExternalLinkClose(), Text(text="!?,")]
-
- ---
-
- name: close_paren_after_excluded
- label: a closing parenthesis after a free link that is excluded
- input: "http://example.)com)"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.)com"), ExternalLinkClose(), Text(text=")")]
-
- ---
-
- name: close_paren_after_included
- label: a closing parenthesis after a free link that is included because of an opening parenthesis in the URL
- input: "http://example.(com)"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.(com)"), ExternalLinkClose()]
-
- ---
-
- name: open_bracket_inside
- label: an open bracket inside a free link that causes it to be ended abruptly
- input: "http://foobar[baz.com"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://foobar"), ExternalLinkClose(), Text(text="[baz.com")]
-
- ---
-
- name: brackets_period_after
- label: a period after a bracket-enclosed link that is included
- input: "[http://example.com. Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com."), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: brackets_punct_after
- label: punctuation after a bracket-enclosed link that are included
- input: "[http://example.com/foo:bar.:;baz!?, Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.com/foo:bar.:;baz!?,"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: brackets_close_paren_after_included
- label: a closing parenthesis after a bracket-enclosed link that is included
- input: "[http://example.)com) Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.)com)"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: brackets_close_paren_after_included_2
- label: a closing parenthesis after a bracket-enclosed link that is also included
- input: "[http://example.(com) Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://example.(com)"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: brackets_open_bracket_inside
- label: an open bracket inside a bracket-enclosed link that is also included
- input: "[http://foobar[baz.com Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="http://foobar[baz.com"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: adjacent_space
- label: two free links separated by a space
- input: "http://example.com http://example.com"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text=" "), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose()]
-
- ---
-
- name: adjacent_newline
- label: two free links separated by a newline
- input: "http://example.com\nhttp://example.com"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text="\n"), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose()]
-
- ---
-
- name: adjacent_close_bracket
- label: two free links separated by a close bracket
- input: "http://example.com]http://example.com"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text="]"), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose()]
-
- ---
-
- name: html_entity_in_url
- label: a HTML entity parsed correctly inside a free link
- input: "http://exa mple.com/"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://exa"), HTMLEntityStart(), Text(text="nbsp"), HTMLEntityEnd(), Text(text="mple.com/"), ExternalLinkClose()]
-
- ---
-
- name: template_in_url
- label: a template parsed correctly inside a free link
- input: "http://exa{{template}}mple.com/"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://exa"), TemplateOpen(), Text(text="template"), TemplateClose(), Text(text="mple.com/"), ExternalLinkClose()]
-
- ---
-
- name: argument_in_url
- label: an argument parsed correctly inside a free link
- input: "http://exa{{{argument}}}mple.com/"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://exa"), ArgumentOpen(), Text(text="argument"), ArgumentClose(), Text(text="mple.com/"), ExternalLinkClose()]
-
- ---
-
- name: wikilink_in_url
- label: a wikilink that destroys a free link
- input: "http://exa[[wikilink]]mple.com/"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://exa"), ExternalLinkClose(), WikilinkOpen(), Text(text="wikilink"), WikilinkClose(), Text(text="mple.com/")]
-
- ---
-
- name: external_link_in_url
- label: a bracketed link that destroys a free link
- input: "http://exa[http://example.com/]mple.com/"
- output: [ExternalLinkOpen(brackets=False), Text(text="http://exa"), ExternalLinkClose(), ExternalLinkOpen(brackets=True), Text(text="http://example.com/"), ExternalLinkClose(), Text(text="mple.com/")]
-
- ---
-
- name: spaces_padding
- label: spaces padding a free link
- input: " http://example.com "
- output: [Text(text=" "), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text=" ")]
-
- ---
-
- name: text_and_spaces_padding
- label: text and spaces padding a free link
- input: "x http://example.com x"
- output: [Text(text="x "), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose(), Text(text=" x")]
-
- ---
-
- name: template_before
- label: a template before a free link
- input: "{{foo}}http://example.com"
- output: [TemplateOpen(), Text(text="foo"), TemplateClose(), ExternalLinkOpen(brackets=False), Text(text="http://example.com"), ExternalLinkClose()]
-
- ---
-
- name: spaces_padding_no_slashes
- label: spaces padding a free link with no slashes after the colon
- input: " mailto:example@example.com "
- output: [Text(text=" "), ExternalLinkOpen(brackets=False), Text(text="mailto:example@example.com"), ExternalLinkClose(), Text(text=" ")]
-
- ---
-
- name: text_and_spaces_padding_no_slashes
- label: text and spaces padding a free link with no slashes after the colon
- input: "x mailto:example@example.com x"
- output: [Text(text="x "), ExternalLinkOpen(brackets=False), Text(text="mailto:example@example.com"), ExternalLinkClose(), Text(text=" x")]
-
- ---
-
- name: template_before_no_slashes
- label: a template before a free link with no slashes after the colon
- input: "{{foo}}mailto:example@example.com"
- output: [TemplateOpen(), Text(text="foo"), TemplateClose(), ExternalLinkOpen(brackets=False), Text(text="mailto:example@example.com"), ExternalLinkClose()]
-
- ---
-
- name: no_slashes
- label: a free link with no slashes after the colon
- input: "mailto:example@example.com"
- output: [ExternalLinkOpen(brackets=False), Text(text="mailto:example@example.com"), ExternalLinkClose()]
-
- ---
-
- name: slashes_optional
- label: a free link using a scheme that doesn't need slashes, but has them anyway
- input: "mailto://example@example.com"
- output: [ExternalLinkOpen(brackets=False), Text(text="mailto://example@example.com"), ExternalLinkClose()]
-
- ---
-
- name: short
- label: a very short free link
- input: "mailto://abc"
- output: [ExternalLinkOpen(brackets=False), Text(text="mailto://abc"), ExternalLinkClose()]
-
- ---
-
- name: slashes_missing
- label: slashes missing from a free link with a scheme that requires them
- input: "http:example@example.com"
- output: [Text(text="http:example@example.com")]
-
- ---
-
- name: no_scheme_but_slashes
- label: no scheme in a free link, but slashes (protocol-relative free links are not supported)
- input: "//example.com"
- output: [Text(text="//example.com")]
-
- ---
-
- name: no_scheme_but_colon
- label: no scheme in a free link, but a colon
- input: " :example.com"
- output: [Text(text=" :example.com")]
-
- ---
-
- name: no_scheme_but_colon_and_slashes
- label: no scheme in a free link, but a colon and slashes
- input: " ://example.com"
- output: [Text(text=" ://example.com")]
-
- ---
-
- name: fake_scheme_no_slashes
- label: a nonexistent scheme in a free link, without slashes
- input: "fake:example.com"
- output: [Text(text="fake:example.com")]
-
- ---
-
- name: fake_scheme_slashes
- label: a nonexistent scheme in a free link, with slashes
- input: "fake://example.com"
- output: [Text(text="fake://example.com")]
-
- ---
-
- name: fake_scheme_brackets_no_slashes
- label: a nonexistent scheme in a bracketed link, without slashes
- input: "[fake:example.com]"
- output: [Text(text="[fake:example.com]")]
-
- ---
-
- name: fake_scheme_brackets_slashes
- label: #=a nonexistent scheme in a bracketed link, with slashes
- input: "[fake://example.com]"
- output: [Text(text="[fake://example.com]")]
-
- ---
-
- name: interrupted_scheme
- label: an otherwise valid scheme with something in the middle of it, in a free link
- input: "ht?tp://example.com"
- output: [Text(text="ht?tp://example.com")]
-
- ---
-
- name: interrupted_scheme_brackets
- label: an otherwise valid scheme with something in the middle of it, in a bracketed link
- input: "[ht?tp://example.com]"
- output: [Text(text="[ht?tp://example.com]")]
-
- ---
-
- name: no_slashes_brackets
- label: no slashes after the colon in a bracketed link
- input: "[mailto:example@example.com Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="mailto:example@example.com"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: space_before_no_slashes_brackets
- label: a space before a bracketed link with no slashes after the colon
- input: "[ mailto:example@example.com Example]"
- output: [Text(text="[ "), ExternalLinkOpen(brackets=False), Text(text="mailto:example@example.com"), ExternalLinkClose(), Text(text=" Example]")]
-
- ---
-
- name: slashes_optional_brackets
- label: a bracketed link using a scheme that doesn't need slashes, but has them anyway
- input: "[mailto://example@example.com Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="mailto://example@example.com"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: short_brackets
- label: a very short link in brackets
- input: "[mailto://abc Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="mailto://abc"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: slashes_missing_brackets
- label: slashes missing from a scheme that requires them in a bracketed link
- input: "[http:example@example.com Example]"
- output: [Text(text="[http:example@example.com Example]")]
-
- ---
-
- name: protcol_relative
- label: a protocol-relative link (in brackets)
- input: "[//example.com Example]"
- output: [ExternalLinkOpen(brackets=True), Text(text="//example.com"), ExternalLinkSeparator(), Text(text="Example"), ExternalLinkClose()]
-
- ---
-
- name: scheme_missing_but_colon_brackets
- label: scheme missing from a bracketed link, but with a colon
- input: "[:example.com Example]"
- output: [Text(text="[:example.com Example]")]
-
- ---
-
- name: scheme_missing_but_colon_slashes_brackets
- label: scheme missing from a bracketed link, but with a colon and slashes
- input: "[://example.com Example]"
- output: [Text(text="[://example.com Example]")]
-
- ---
-
- name: unclosed_protocol_relative
- label: an unclosed protocol-relative bracketed link
- input: "[//example.com"
- output: [Text(text="[//example.com")]
-
- ---
-
- name: space_before_protcol_relative
- label: a space before a protocol-relative bracketed link
- input: "[ //example.com]"
- output: [Text(text="[ //example.com]")]
-
- ---
-
- name: unclosed_just_scheme
- label: an unclosed bracketed link, ending after the scheme
- input: "[http"
- output: [Text(text="[http")]
-
- ---
-
- name: unclosed_scheme_colon
- label: an unclosed bracketed link, ending after the colon
- input: "[http:"
- output: [Text(text="[http:")]
-
- ---
-
- name: unclosed_scheme_colon_slashes
- label: an unclosed bracketed link, ending after the slashes
- input: "[http://"
- output: [Text(text="[http://")]
-
- ---
-
- name: incomplete_bracket
- label: just an open bracket
- input: "["
- output: [Text(text="[")]
-
- ---
-
- name: incomplete_scheme_colon
- label: a free link with just a scheme and a colon
- input: "http:"
- output: [Text(text="http:")]
-
- ---
-
- name: incomplete_scheme_colon_slashes
- label: a free link with just a scheme, colon, and slashes
- input: "http://"
- output: [Text(text="http://")]
-
- ---
-
- name: brackets_scheme_but_no_url
- label: brackets around a scheme and a colon
- input: "[mailto:]"
- output: [Text(text="[mailto:]")]
-
- ---
-
- name: brackets_scheme_slashes_but_no_url
- label: brackets around a scheme, colon, and slashes
- input: "[http://]"
- output: [Text(text="[http://]")]
-
- ---
-
- name: brackets_scheme_title_but_no_url
- label: brackets around a scheme, colon, and slashes, with a title
- input: "[http:// Example]"
- output: [Text(text="[http:// Example]")]
-
- ---
-
- name: url_preceded_by_non_word_character
- label: non-word character immediately before a valid URL
- input: "svn+ssh://server.domain.com:/reponame"
- output: [Text(text="svn+"), ExternalLinkOpen(brackets=False), Text(text="ssh://server.domain.com:/reponame"), ExternalLinkClose()]
-
- ---
-
- name: url_preceded_by_underscore
- label: underscore immediately before a valid URL
- input: "svn_ssh://server.domain.com:/reponame"
- output: [Text(text="svn_ssh://server.domain.com:/reponame")]
|