Uploaded image for project: 'Markdown Syntax'
  1. Markdown Syntax
  2. MARKDOWN-31

Only support URLs and email addresses in autolinks and [...](...) links

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 8.4
    • 8.3
    • markdown/1.2
    • None

    Description

      See also MARKDOWN-25 and MARKDOWN-14.

      Reminder: Markdown links don't support spaces in references by default because a title can be specified (optional). The syntax is: [label](reference "title").

      So I see 2 options:

      Option 1

      Have different use cases for the 2 link syntaxes:

      • For URLs (absolute or relative) and mail links (mailto:), use [...](...).
      • For other links (wiki page links, etc), use [[...|...]]

      Pros:

      • No need for a configuration option to decide how to render links (i.e. WYSIWYG won't change the link format).
      • We can URL-decode the links using the [...](...) syntax, thus allowing to pass special characters such as spaces, etc.

      Option 2

      Allow to use any syntax for all types of links.

      In order to support spaces in wiki pages when using the [...](...) syntax we have 2 more options:

      Option 2.1

      Always URL-decode the reference.

      Cons:

      • If the user wants to have % in a wiki page name for example, he'll need to escape it with %25.
      • We need a configuration parameter to tell which syntax to use when rendering links. It means that the user will see some conversion from one syntax to another which isn't that nice.

      Option 2.2

      Modify the original MD spec and use quotes when you need to pass a space.

      For example: [...]("page with space" "title")

      Note that in this option we would not URL-decode the reference at all.

      Pros:

      • Friendly for users who are used to the [...](...) syntax, till they start needing to link to a page with a space in its name.

      Cons:

      • We need a configuration parameter to tell which syntax to use when rendering links. It means that the user will see some conversion from one syntax to another which isn't that nice.

      WDYT?

      I think my preference goes to option 1.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: