Support Markdown "stack overflow" style hyperlinks markup

Bug #391780 reported by Michael B. Trausch on 2009-06-24
226
This bug affects 43 people
Affects Status Importance Assigned to Milestone
Launchpad itself
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

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?

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

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) on 2009-12-30
affects: launchpad → launchpad-foundations
Changed in launchpad-foundations:
importance: Undecided → Low
status: New → Triaged
Curtis Hovey (sinzui) on 2010-11-14
tags: added: feature
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) on 2010-11-14
summary: - Support "stack overflow" style hyperlinks
+ Support "stack overflow" style hyperlinks markup
Martin Pool (mbp) on 2011-02-04
summary: - Support "stack overflow" style hyperlinks markup
+ Support Markdown "stack overflow" style hyperlinks markup
Martin Pool (mbp) on 2011-11-20
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Martin Pool (mbp)
tags: added: markdown
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

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.

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

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.

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.

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

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'

Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
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
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
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.

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
Germar (germar) wrote :

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

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...

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

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.

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

Other bug subscribers

Related questions