github.com/nhannv/mattermost-server@v5.11.1+incompatible/tests/test-links.md (about)

     1  # Link Testing
     2   
     3  Links in Mattermosts should render as specified below.
     4  
     5  #### These strings should auto-link:
     6   
     7  http://example.com
     8  https://example.com
     9  www.example.com
    10  www.example.com/index
    11  www.example.com/index.html
    12  www.example.com/index/sub
    13  www.example.com/index?params=1
    14  www.example.com/index?params=1&other=2
    15  www.example.com/index?params=1;other=2
    16  http://example.com:8065
    17  http://www.example.com/_/page
    18  www.example.com/_/page
    19  https://en.wikipedia.org/wiki/🐬
    20  https://en.wikipedia.org/wiki/Rendering_(computer_graphics)
    21  http://127.0.0.1
    22  http://192.168.1.1:4040
    23  http://[::1]:80
    24  http://[::1]:8065
    25  https://[::1]:80
    26  http://[2001:0:5ef5:79fb:303a:62d5:3312:ff42]
    27  http://[2001:0:5ef5:79fb:303a:62d5:3312:ff42]:8065
    28  https://[2001:0:5ef5:79fb:303a:62d5:3312:ff42]
    29  test@example.com
    30  http://example.com/more_(than)_one_(parens)
    31  http://example.com/(something)?after=parens
    32  http://foo.com/unicode_(✪)_in_parens
    33  http://✪df.ws/1234
    34  *https://example.com*
    35  _https://example.com_
    36  **https://example.com**
    37  __https://example.com__
    38  ***https://example.com***
    39  ___https://example.com___
    40  <https://example.com>
    41  <https://en.wikipedia.org/wiki/Rendering_(computer_graphics)>
    42  www1.example.com
    43  [This whole #sentence should be a link](https://example.com)
    44  https://groups.google.com/forum/#!msg
    45  
    46  #### These strings should not auto-link:
    47  
    48  example.com
    49  readme.md
    50  @example.com
    51  ./make-compiled-client.sh
    52  test.:test
    53  `https://example.com`
    54  
    55  #### Only the links within these sentences should auto-link:
    56  
    57  (http://example.com)
    58  (see http://example.com)
    59  (http://example.com watch this)
    60  (test@example.com)
    61  This is a sentence with a http://example.com in it.
    62  This is a sentence with a [link](http://example.com) in it.
    63  This is a sentence with a http://example.com/_/underscore in it.
    64  This is a sentence with a link (http://example.com) in it.
    65  This is a sentence with a (https://en.wikipedia.org/wiki/Rendering_(computer_graphics)) in it.
    66  This is a sentence with a http://192.168.1.1:4040 in it.
    67  This is a sentence with a https://[::1]:80 in it.
    68  This is a link to http://example.com.
    69  This is a link containing http://example.com/something?with,commas,in,url, but not at end
    70  This is a question about a link http://example.com?
    71  
    72  #### These links should auto-link to the specified location:
    73  
    74  [example link](example.com) links to `http://example.com`
    75  [example.com](example.com) links to `http://example.com`
    76  [example.com/other](example.com) links to `http://example.com`
    77  [example.com/other_link](example.com/example) links to `http://example.com/example`
    78  www.example.com links to `http://www.example.com`
    79  https://example.com links to `https://example.com` and not `http://example.com`
    80  https://en.wikipedia.org/wiki/🐬 links to the Wikipedia article on dolphins
    81  https://en.wikipedia.org/wiki/URLs#Syntax links to the Syntax section of the Wikipedia article on URLs
    82  test@example.com links to `mailto:test@example.com`
    83  [email link](mailto:test@example.com) links to `mailto:test@example.com` and not `http://mailto:test@example.com`
    84  [other link](ts3server://example.com) links to `ts3server://example.com` and not `http://ts3server://example.com`
    85  test_underscore@example.com links to `mailto:test_underscore@example.com`
    86  <test@example.com> with angle brackets links to `mailto:test@example.com` and not `http://mailto:test@example.com`
    87  [link with spaces](example.com/ spaces in the url) links to either `http://example.com/ spaces in the url` or `http://example.com/%20spaces%20in%20the%20url`
    88  
    89  #### These links should have tooltips when you hover over them
    90  [link](example.com "catch phrase!") should have the tooltip `catch phrase!`
    91  [link](example.com "title with "quotes"") should have the tooltip `title with "quotes"`
    92  [link with spaces](example.com/ spaces in the url "and a title") should have the tooltip `and a title`