HTML links to Markdown

Quick regular expression snippet to convert HTML links to Markdown links:

Find:

<a href=\\"(.*?)\\">(.*?)</a>

Replace:

[$2]($1)

(Try it in TextMate, for example, which has an awesome find/replace dialog that accepts regular expressions.)

Creative Commons LicenseThe HTML links to Markdown article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Post Metadata

Date
July 15th, 2008

Author
Aral

Category

Tags


Leave a Reply

Anti-Spam Protection by WP-SpamFree