Need someone to lead product or development at your software company? I lead product and engineering teams and I'm looking for my next opportunity. Check out my resume and get in touch.

Autolink URLs in MT Entries

Freshness Warning
This article is over 15 years old. It's possible that the information you read below isn't current.

One of the things I really hate about reading newspaper Web sites is they often include URLs but don’t link them. So you have to copy and paste to open them (or just rightclick with the right Firefox extension).

I don’t want my site to look like a big, dumb newspaper. So I wrote a filter using Brad’s regex plugin to autolink URLs in entries. It hasn’t been extensively tested but it has worked for a the half-dozen or so entries in the Project X blog.

Install the regex plugin and then add this to the top of your templates…

<MTAddRegex name="autolink">s![> ](http://[^<" ]+)!<a href="$1">$1</a> !g</MTAddRegex>

Then add the attribute regex="autolink" to your MTEntryBody and MTEntry more tags in your templates: <MTEntryBody regex="autolink">.

Trackback from Movalog Sideblog
August 16, 2004 10:32 PM

Autolink URLs in MT Entries

Excerpt: Autolink URLs in MT Entries...

Terrence Wood
August 17, 2004 5:35 PM

I don't have MT installed, but I think this regex will also replace existing links, and should read: s![^">](http://[^<" ]+)! <a href="$1">$1</a> !g

Trackback from Lummaland
August 17, 2004 11:27 PM

Plain Text Links

Excerpt: Die Extension Plain Text Links für Firefox ist unspektakulär, aber klasse. Für all die Websites, insbesondere Online-Ausgaben der Zeitungen, die nicht in der Lage sind, einen URL auch klickbar zu ma...

Adam Kalsey
August 18, 2004 11:38 AM

No, the [> ] in my original regex means that the pattern will only match URLs that immediately follow a > (the end of a tag) or a blank space. So it won't match a URL in an anchor tag.

peter
March 27, 2006 7:26 PM

For me, the regex you supplied only works on the first link immediately after a paragraph tag - and then it mucks up the paragraph tag like so: <p<a href= 'sup with that.

This discussion has been closed.

Recently Written

A framework for onboarding new employees (May 15)
There’s no single good way to onboard an employee that works for every role. Here's a framework for creating a process that you can adapt to each situation.
TV hosts as a guide for software managers (May 10)
Software managers can learn a lot from journalists or late night TV hosts and how they interview people.
The Improvement Flywheel (Apr 29)
An incredible flywheel for the improvement of a development team. Fix a few things, and everything starts getting better.
Managers and technical ability (Dec 26)
In technical fields, the closer you are to the actual work being done, the closer your skills need to resemble those of the people doing the work.
Dysfunctions of output-oriented software teams (Sep 17)
Whatever you call it, the symptom is that you're measuring your progress by how much you build and deliver instead of measuring success by the amount of customer value you create.
Evaluative and generative product development (Aug 30)
Customers never even talk to the companies that don't fit their needs at all. If the only product ideas you're considering are those that meet the needs of your current customers, then you're only going to find new customers that look exactly like your current customers.
Product Manager Career Ladder (Aug 19)
What are the steps along the product management career path?
Building the Customer-Informed Product (Aug 15)
Strong products aren't composed of a list of features dictated by customers. They are guided by strong visions, and the execution of that vision is the primary focus of product development.

Older...

What I'm Reading

Contact

Adam Kalsey

+1 916 600 2497

Resume

Public Key

© 1999-2020 Adam Kalsey.