Support Markdown "stack overflow" style hyperlinks markup

Bug #391780 reported by Michael B. Trausch
266
This bug affects 53 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Stack Overflow has a rather nifty way of specifying a hyperlink in a safe manner. As an example, take the text from bug 391777; on SO the following snippet would be written thus:

Upstream has been notified of the bug and [fixed it][1] in the [git tree][2]. Attached is a debdiff to fix this issue in Ubuntu 9.04, which I have personally tested and verified that it works. This change will be in libwnck that is distributed with GNOME 2.28, but it would be nice if this change is also applied and released in Ubuntu 9.04 with GNOME 2.26.

At the end of the text with the links in it are the link definitions:

[1]: http://bugzilla.gnome.org/show_bug.cgi?id=586571
[2]: http://git.gnome.org/cgit/libwnck/commit/?id=703919ef4bda4e6fb9e60a4df7bd149a056b42ed

The parser would then change the text in the paragraph to have hyperlinks for HTML views, and preserve the real text for plain-text representations such as email messages/notifications.

This would make it possible to do things such as make references to other important information in a way that is non-intrusive as well as intuitive when reading a bug report that depends on external information.

Related branches

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

If we're going to allow a special syntax for hyperlinks, how about using a syntax more widely known among Launchpad users, such as MoinMoin or even Markdown?

Revision history for this message
Michael B. Trausch (mtrausch) wrote : Re: [Bug 391780] Re: Support "stack overflow" style hyperlinks

On Thu, 25 Jun 2009, Matthew Paul Thomas wrote:

> If we're going to allow a special syntax for hyperlinks, how about using
> a syntax more widely known among Launchpad users, such as MoinMoin or
> even Markdown?

The "Stack Overflow" method is simply a minor adaptation of what many people
do in plain-text email and it is as easy to write as it is to read. Wikicode
(at least for any wiki I have seen) isn't. Hence the suggestion.

  --- Mike

Revision history for this message
Michael B. Trausch (mtrausch) wrote : Re: Support "stack overflow" style hyperlinks

It is probably also worth noting that Server Fault and a third incarnation targeted at end-user support will be using the same system. If the popularity of Stack Overflow is any indication, many people will rather quickly be familiar with this mechanism for hyperlinks both within and outside of the LP user base.

Using Wikicode could work, but it'd be (I think) too intrusive in emails. This setup lets the plaintext still go out and be readable/parseable by humans, while the site would just render it with a hyperlink and hide the bracketed notation altogether.

Curtis Hovey (sinzui)
affects: launchpad → launchpad-foundations
Changed in launchpad-foundations:
importance: Undecided → Low
status: New → Triaged
Curtis Hovey (sinzui)
tags: added: feature
Revision history for this message
Emilien Klein (emilien-klein) wrote :

Since AskUbuntu.com is also in the realm of the Stack Exchange platform, more and more Ubuntu users might/will get exposed to Markdown (what powers the" stack overflow style hyperlinks").

Curtis Hovey (sinzui)
summary: - Support "stack overflow" style hyperlinks
+ Support "stack overflow" style hyperlinks markup
Martin Pool (mbp)
summary: - Support "stack overflow" style hyperlinks markup
+ Support Markdown "stack overflow" style hyperlinks markup
Martin Pool (mbp)
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Martin Pool (mbp)
tags: added: markdown
Revision history for this message
Martin Pool (mbp) wrote :

This is now partly done in the attached branch.

Still to do:

 * document the flag
 * continue to mark up things Launchpad already recognizes including bugs, branches, etc
 * css for tables
 * as a follow on it might be useful to put them in memcached

Revision history for this message
Martin Pool (mbp) wrote :

also
 * disable linking (or perhaps all markup?) by untrusted users?
 * insert <a rel=nofollow> - but do we really care? the vast majority of content is trustworthy and has useful links, and we have mechanisms for getting rid of spam
 * possibly, css to make things inside

One open question is about how to handle newlines:
 * original markdown ignores single newlines unless they're preceded by two trailing space characters - exactly the sort of significant trailing whitespace that is a pain in the butt in moin
 * github, stackexchange, perhaps others, treat newlines as hard line breaks; this can be accomplished with http://www.freewisdom.org/projects/python-markdown/nl2br

the former is arguably better for incoming email, but even there if it's correctly typed as format flowed we have a chance to detect which newlines are really soft vs hard.

Revision history for this message
Martin Pool (mbp) wrote :

 * rendered html needs to be inserted into edit widgets
 * saving the edit widget needs to get back and insert the rendered html

Revision history for this message
Gavin Panella (allenap) wrote :

> * insert <a rel=nofollow> - but do we really care? the vast majority
> of content is trustworthy and has useful links, and we have
> mechanisms for getting rid of spam

I think this is the reason why most content is okay; Launchpad is not
an interesting target for link spam. If we stop adding nofollow to
user-provided links we will become more interesting to spammers.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 391780] Re: Support Markdown "stack overflow" style hyperlinks markup

On 21 November 2011 02:21, Gavin Panella <email address hidden> wrote:
>> * insert <a rel=nofollow> - but do we really care? the vast majority
>>   of content is trustworthy and has useful links, and we have
>>   mechanisms for getting rid of spam
>
> I think this is the reason why most content is okay; Launchpad is not
> an interesting target for link spam. If we stop adding nofollow to
> user-provided links we will become more interesting to spammers.

I had a look at askubuntu, github, some other comparable user content
sites. Most do use nofollow. We don't need any more spam attention.

Revision history for this message
Martin Pool (mbp) wrote :

Performance discussion conclusions:
 * locally measured performance seems at least plausible enough to do a limited beta
 * not worth worrying about doing anything with memcached now

Revision history for this message
Martin Pool (mbp) wrote :

also to do:

 * i'm going to work on a python-markdown extension, which I will send upstream, to add rel=nofollow.
 * markdown by default doesn't linkify urls and we want that
 * we also need to linkify patterns we currently match like 'bug 391780'

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Revision history for this message
Martin Pool (mbp) wrote :

https://bugs.qastaging.aunchpad.net/launchpad/ seems to be not responding at the moment.

tags: added: qa-untestable
removed: qa-needstesting
Revision history for this message
Martin Pool (mbp) wrote :

qa: https://qastaging.launchpad.net/~mbp and https://qastaging.launchpad.net/launchpad are rendering ok, so this hasn't broken anything when the flag is off.

tags: added: qa-ok
removed: qa-untestable
Revision history for this message
Robert Collins (lifeless) wrote :

for linkification of bugs - there is a -big- regex to check :) - it
handles all the things e.g. oopses, urls, bugs, etc - have a dig
around the guts, I'm sure you'll find it.

Revision history for this message
Martin Pool (mbp) wrote :

On 28 November 2011 09:44, Robert Collins <email address hidden> wrote:
> for linkification of bugs - there is a -big- regex to check :) - it
> handles all the things e.g. oopses, urls, bugs, etc - have a dig
> around the guts, I'm sure you'll find it.

Yep, I see it. I am planning to add a Launchpad-specific markdown
extension class that if possible applies the same regexp to do the
same transformations.

Changed in launchpad:
assignee: Martin Pool (mbp) → nobody
status: In Progress → Triaged
Revision history for this message
Germar (germar) wrote :

Any progress on this? We really need markdown for e.g code blocks in FAQ and Question/Answers!

Revision history for this message
Jason M. (jason-ubuntu) wrote :

Is this dead? No hope of markdown? Seems sort of way behind for something w/ &copy; 2014 stamped on it...

Revision history for this message
Pierre Equoy (pieq) wrote :

Any update on this one?

I would love to have Markdown support in Launchpad... As I just wrote in a question [1], commonmark.org provides a nice specification document, so it could be worthy to use this or one of the implementations.

I hope we'll see this feature land soon!

[1] https://answers.launchpad.net/launchpad/+question/261268

Revision history for this message
Tao Wang (twang2218) wrote :

It would be much better if launchpad can support Github style Markdown ability, even a basic markdown support would help to structure the issue description a lot, especially helpful for codes.

Revision history for this message
Tero Gusto (tero-gusto) wrote (last edit ):

Markdown has become the de facto standard, used at for example GitLab, GitHub and Stack Overflow, so it would be great if not only hyperlinks, but the complete Markdown formatting conventions was also adapted for Launchpad itself, and available everywhere. Both in the Bug Description, but also comments, such as this one.

## GitLab
https://docs.gitlab.com/ee/user/markdown.html

## Stack Overflow
https://stackoverflow.com/editing-help

## GitHub
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

Revision history for this message
jeremyszu (os369510) wrote :

Yes, it would be an excellent feature support for the users/developers if we would like to promote the Launchpad.

I believe we would like to maintain the information/discussion on Launchpad as much as possible. The current bug description / comments are not quite friendly to read for users.

If we can improve the user experience, then I believe it can help us to promote the Launchpad for our external counterparts.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.