Joplin: More closely follow CommonMark for link auto-generation.

Created on 27 Sep 2020  路  3Comments  路  Source: laurent22/joplin

Current behaviour

Proposed behaviour

In general Joplin auto-links too much text, which is not necessary as Markdown already provides way to explicitly create a link. It is reasonable to auto-link URLs that start with a valid URL schemes, but other cases should be disabled.

CommonMark does not auto-link anything except for URLs within < >

enhancement high renderer spec

Most helpful comment

Personal opinion is that Joplin should follow Commonmark. Any active links would have to be explicitly defined using the [name](link) or <link> formats. This would mean that any exported Markdown should be reproduced, as intended by the author, in any other Markdown-based app and would also remove the chance of "false positives".

HOWEVER

I appreciate that a certain amount of "auto-linking" adds somewhat to the ease and speed of use and, if an option to switch off auto-linking is not considered suitable, a logic that minimises "false positives" (as proposed above) sounds like a good compromise. Some URL-like text would still have to be purposefully "neutered" using HTML to break the hyperlink but the occurrance of such situations should be reduced.

All 3 comments

Personal opinion is that Joplin should follow Commonmark. Any active links would have to be explicitly defined using the [name](link) or <link> formats. This would mean that any exported Markdown should be reproduced, as intended by the author, in any other Markdown-based app and would also remove the chance of "false positives".

HOWEVER

I appreciate that a certain amount of "auto-linking" adds somewhat to the ease and speed of use and, if an option to switch off auto-linking is not considered suitable, a logic that minimises "false positives" (as proposed above) sounds like a good compromise. Some URL-like text would still have to be purposefully "neutered" using HTML to break the hyperlink but the occurrance of such situations should be reduced.

Personal opinion is that Joplin should follow Commonmark.

Yes, ideally I'd prefer to stick closely to the CommonMark spec. It's hard to evaluate whether we really need auto-links for URL-like text. I don't think I need it much personally. Perhaps it's a matter of disabling it completely and see what users will say. We can always document that they should add <> around the URLs.

Well, that's the thing. I believe people are really split on that topic. That's why an option would make sense. Especially since it is just a boolean for the markdown-it renderer. Adding additional code to have a "better" link recognition actually is against your initial sentiment with regards to code maintenance.
Setting a flag however has no maintenance implications.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smhearty picture smhearty  路  3Comments

laurent22 picture laurent22  路  3Comments

jurgenhaas picture jurgenhaas  路  3Comments

jmcastagnetto picture jmcastagnetto  路  3Comments

Cybernemo picture Cybernemo  路  3Comments