💾 Archived View for gmi.noulin.net › gitRepositories › md4c › file › test › permissive-url-autolinks… captured on 2023-01-29 at 13:23:54. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

md4c

Log

Files

Refs

README

LICENSE

permissive-url-autolinks.txt (2216B)

     1 
     2 # Permissive URL Autolinks
     3 
     4 With the flag `MD_FLAG_PERMISSIVEURLAUTOLINKS`, MD4C enables more permissive recognition
     5 of URLs and transform them to autolinks, even if they do not exactly follow the syntax
     6 of autolink as specified in CommonMark specification.
     7 
     8 This is standard CommonMark autolink:
     9 
    10 ```````````````````````````````` example
    11 Homepage: <https://github.com/mity/md4c>
    12 .
    13 <p>Homepage: <a href="https://github.com/mity/md4c">https://github.com/mity/md4c</a></p>
    14 ````````````````````````````````
    15 
    16 With the permissive autolinks enabled, this is sufficient:
    17 
    18 ```````````````````````````````` example
    19 Homepage: https://github.com/mity/md4c
    20 .
    21 <p>Homepage: <a href="https://github.com/mity/md4c">https://github.com/mity/md4c</a></p>
    22 ````````````````````````````````
    23 
    24 But this permissive autolink feature can work only for very widely used URL
    25 schemes, in alphabetical order `ftp:`, `http:`, `https:`.
    26 
    27 That's why this is not a permissive autolink:
    28 
    29 ```````````````````````````````` example
    30 ssh://root@example.com
    31 .
    32 <p>ssh://root@example.com</p>
    33 ````````````````````````````````
    34 
    35 The same rules for path validation as for permissivve WWW autolinks apply.
    36 Therefore the final question mark here is not part of the autolink:
    37 
    38 ```````````````````````````````` example
    39 Have you ever visited http://www.zombo.com?
    40 .
    41 <p>Have you ever visited <a href="http://www.zombo.com">http://www.zombo.com</a>?</p>
    42 ````````````````````````````````
    43 
    44 But in contrast, in this example it is:
    45 
    46 ```````````````````````````````` example
    47 http://www.bing.com/search?q=md4c
    48 .
    49 <p><a href="http://www.bing.com/search?q=md4c">http://www.bing.com/search?q=md4c</a></p>
    50 ````````````````````````````````
    51 
    52 And finally one complex example:
    53 
    54 ```````````````````````````````` example
    55 http://commonmark.org
    56 
    57 (Visit https://encrypted.google.com/search?q=Markup+(business))
    58 
    59 Anonymous FTP is available at ftp://foo.bar.baz.
    60 .
    61 <p><a href="http://commonmark.org">http://commonmark.org</a></p>
    62 <p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p>
    63 <p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p>
    64 ````````````````````````````````